MYSQL Dump from Command Line

Upated Instruction 1/31/2019
Basic mysqldump command. The -p flag will prompt you for your password later. Fill in the example_text with your info.
mysqldump -u user_name -p database_name > desired_file_name.sql

To dump a database from a remote database host you can use the following command.

mysqldump -u user_name -h ip_address -p database_name > desired_file_name.sql

Back up your database from the command line using mysqldump. This works in most Linux based terminals / SSH.

 

[uname] Your database username
[pass] The password for your database (note there is no space between -p and the password)
[dbname] The name of your database
[backupfile.sql] The filename for your database backup
[–opt] The mysqldump option

 

To dump a database from a remote database host you can use the following command.

mysqldump -u user_name -h ip_address -p database_name > desired_file_name.sql