MySQL login and database backup
I need to login to MySQL and backup my database. How can this be done?
1 Reply
You'll need to login to your database server using the 'root' account that you setup for your database. This 'root' account will be different than the 'root' account for your server. You should be able to login to your database using the following syntax:
mysql -u root -p
To backup your database, you can use the 'mysqldump' command. Here's an example of this command:
mysqldump -u root -p database_name > database_name.sql
We actually have a guide on our docs page that you can reference in regards to backing up your database.
If you've forgotten the password for the 'root' account and need to reset this, I found another link in our community forum that will assist you with this process.
https://www.linode.com/community/questions/17930/retrieve-mysql-and-root-password