They say that a system administrator is only as good as his last backup. If you need to backup or restore a MySQL database, you can execute these commands:
Backup the database:
$mysqldump -u <adminuser> -p <password> <databasename> > <databasebackupfile.sql>
For example:
$mysqldump -u root -p myPass mythconverg > mythdatabasebackup.sql
Restore the database:
$mysql -u <adminuser> -p <password> <databasename> < <databasebackupfile.sql>
For example:
$mysql -u root -p myPass mythconverg < mythdatabasebackup.sql
No comments:
Post a Comment