Tuesday, July 21, 2015

Restore MySQL database from a backup file

Backing up your MySQL Databases

The following command will dump all databases to an sql file. Replace pass with your root database password and filename with the name of the file you wish to create such as backup.sql
# mysqldump -u<user> -p<pass> -B --all-databases > <filename>
# mysqldump -uroot -pSuperPass -B --all-databases > all.sql
A single database can be backed up also.
# mysqldump -u<user> -p<pass> <database> > <filename>
# mysqldump -uWiki -pBlue wikidb > wikidb.sql

Restore MySQL database from a backup file

There are many reasons you would want to restore a database from a backup file… But you should also test this on a test server just to make sure that your database backups are working correctly. Here’s the syntax:
mysql -h hostname -u username -pthepassword databasename < dumpfile.sql
Here’s an example:
mysql -h localhost -u root -ptgX!2121 < thedumpfile.sql

1 comment:

  1. However, you may not find it in the same way as different devices are now developing with the latest OS. Hence there is a bit change that comes with every segment like the ringtone stored location. Therefore, in this article, we are going to let you know the different devices custom places so that you come to know yours.

    Did you ever try to know where are notification sounds stored on android? No worries we come with the answer for you. Well, the ringtone is stored in your phone’s folder system>>Media>>Audio and finally you may get to see the ringtones.

    Hopefully, you have already come to know where are ringtones stored on Android. We have shown up a definitive guideline to you in which you can sort out where they go. Depends on your device type it may have some differences and we already shared those too.

    ReplyDelete