Backup & Restore MySQL Database from Shell

- Backup a database

mysqldump -u Username -p dbname > anyname.sql

- Restore a database

mysql -u username database -p < databasefile.sql

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Dangerous Linux Binaries

It's recommended to chmod the following linux binaries to 750 to prevent non-privileged users...

Enable php open_basedir Protection

For open_basedir protection to work properly on cPanel servers running PHP in suPHP mode you'll...

CSF firewall installation

CSF is great firewall for all linux based servers. For non-cpanel servers you'll need to install...

Reset cPanel (WHM) Initial configuration

Have you configured dedicated server with cPanel (WHM) for a client but would like to reset WHM...

Delete shell history

Delete the .bash_history file: # rm -rf ~/.bash_history Clear the current history stored in...