Mysql - Mysqldump backup and restore data, Export and Import mysql database

Mysqldump backup and restore data


To backup a database named 'tutorials_DB' with the username 'root' and with no password to a file tut_backup.sql, you should accomplish this command:
mysqldump -u root -p tutorials_DB > tut_backup.sql

If you are moving your data to a new server, or you have removed the old database completely you can restore it using the code below. This will only work if the database does not already exist:
mysql -u user_name -p mysql_password database_name < file_name.sql
Or using our example from the previous page:
mysql -u root -p your_password LoveData < LoveData.sql
If your database already exists and you are just restoring it, try this line instead:
mysqlimport -u user_name -p your_password database_name file_name.sql
Or using our example again:
mysqlimport -u root -p your_password Love_Restore Love_Backup.sql

The topic on Mysql - Mysqldump backup and restore data is posted by - Math

Hope you have enjoyed, Mysql - Mysqldump backup and restore dataThanks for your time

Tech Bluff