It is very important to backup databases to prevent any loss of data. The easiest way backup the database is Mysqldump and we can restore it with mysql command...
Backup Syntax:
#mysqldump -u [username] -p [databasename] > dumpfilename.sql
Ex: assume that you want to backup a database called users and with username root, then the command would be....
#mysqldump -u root -p users > users.sql
In the above example "-p" will prompt for password, and if your mysql doesnot have any password then no need to use "-p".
Restore Syntax:
Mysqldump file can easily be restored by using the following command
#mysql -u root -p [databasename] < [mysqldumpfile.sql]
EX: #mysql -u root -p users < users.sql
Welcome to the GEEK world, best place where you find topic about latest cutting edge technology on website and mobile. Learn and grow your knowledge with the information and tutorials about Website designing, CSS tutorials, Java Script tutorials, Ruby tutorials, ROR tutorials, HTML tutorials, HTML5 , JQuery, Javascript tutorials, Photoshop tutorials, Flash, games tutorials, Cheat sheets, Design tools, Action Scripts as well as MySql, Oracle and many more in a easy way to use and understand.
No comments:
Post a Comment