how can I backup a mysql database?

Run one of the following commands:

 

  • /path/to/bin/mysqldump -u $mysqlusername -p$mysqlpassword $mysqldatabasename > backup.sql
  • mysqldump -u user -p database > backup_file

There is no space after the -p . If the password was hello, enter -phello

Was this answer helpful?

 Print this Article

Also Read

how do I import a mysql database?

Login to cPanel. Locate and click on the "phpMyAdmin" icon under the "Databases" category....

what is mysql?

MySQL is a database management system based on SQL – Structured Query Language. The app is used...

how do I remove a mysql user from a database?

Login to cPanel. Locate and click on the "MySQL Databases" icon within the "Databases"...

why does mysql give an access denied error for root@localhost?

To avoid this issue, ensure that the MySQL root password is in the /root/.my.cnf file on the...

how do I configure a mysql database for remote connection?

Determine the IP address that you will use to connect to the database. Add this IP address to...