MySQL Backup Command Line Program
Automatic Backup Scheduler for MySQL >
Help Document > MySQL Backup Command Line Program
MySQL Backup Command Line Program
How to back up or restore MySQL databases by MySQL Backup Command Line Program?
Automatic Backup Scheduler for MySQL offers a Command Line Program, you can use it to back up and restore MySQL databases manually.
Open the command prompt window and enter the full path of the installation folder, enter "mysqlbackup.exe" to use MySQL Backup Command Line Program.
For example:
C:\>cd C:\Program Files\Automatic Backup Scheduler for MySQL
C:\Program Files\Automatic Backup Scheduler for MySQL>mysqlbackup.exe
Or you can enter "mysqlbackup.exe" directly under any folders in the command prompt windows if you have added the application directory to your environmental path.
Help for command line:
Enter --help to show the options of MySQL Backup Command Line Program.
Use commands as the following samples to run a task:
- mysqlbackup --from [CONNECTION OPTIONS] --to [CONNECTION OPTIONS] --database [DB]
- mysqlbackup --from [CONNECTION OPTIONS] --to --file [FILE PATH] --databases [DB1 DB2 ...]
- mysqlbackup --from --file [FILE PATH] --to [CONNECTION OPTIONS] --all-databases
For example:
mysqlbackup --from -h www.databasethink.com --port 3306 -u root -p admin --to --file "C:\Users\Administrator\Documents\databasethink.sql" --all-databases
Note:
- Please grant the user account enough privileges to access the remote MySQL database ( % or a specified IP address ).
- Please grant the user account enough rights to create files under the specified folder.
The detailed description of the parameters:
- --from : Set the connection options of source MySQL server or file to back up or restore.
- --to: Set the connection options of destination MySQL server or file to back up or restore.
- [CONNECTION OPTIONS]: They are available in --from and --to.
- -h name: The host name ( e.g. www.databasethink.com ) or IP address ( e.g. 127.0.0.1 ) of the MySQL server.
- --port number : The port of the MySQL server, the default port is 3306.
- -u name: The name of the user on the MySQL server.
- -p[ name]: The user's password on the MySQL server. It is not necessary if the user has no password.
- --default-character-set name: Set the default character set. It's used for non-English ( German, French, Italian, Russian, Chinese, Japanese, Korean, etc. ). It includes Unicode, UTF8, etc. The default value ( Automaticlly detect ) is recommended.
- --protocol name: The protocol to use for connection (tcp, socket, pipe, memory).
- --compress: Use compression in server/client protocol to connect to a MySQL server, if the server permits compression connections. It's used to reduce network traffic.
- --ssl: Use SSL protocol to connect to a MySQL server, if the server permits SSL connections. It allows you to establish secure network connections.
- --ssl-ca name: The full path name to a directory that contains trusted SSL CA certificates in PEM format.
- --ssl-cert name: The path name to the certificate file ( X509 cert in PEM format ).
- --ssl-cipher name: A list of permissible ciphers to use for SSL encryption. It includes AES256, DHE, RSA and SHA.
- --ssl-key name: The path name to the key file ( X509 key in PEM format ).
- --ssl-verify-server-cert: Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.
- --socket name: The socket file to use for connecting to a MySQL server, if the server permits socket connections.
- --pipe-name name: The pipe name of named pipes to use for connecting to a MySQL server, if the server permits socket connections.
- --shared-memory-base-name: The base name of the Shared-Memory to use for connecting to a MySQL server, if the server permits shared-memory connections.
- --file FILE PATH: Enter the source or destination file to restore or back up.
- --database name: Enter a single database which you want to back up or restore.
- --databases name1 name2 ...: Enter multiple databases ( separated by space ) which you want to back up or restore.
- --all-databases: Back up or restore all databases without the system databases.
- --all-tablespaces: Back up or restore all tablespaces.
- --no-tablespaces: Don't back up or restore any tablespaces.
How to back up or restore MySQL databases by Windows GUI program?