This is really the most handy tool for mysql databases. A built in mysqldump can be used via shell to dump mysql databases within a few minutes. Sometimes dumping backups using phpmyadmin is too hazardous. So it’s really a necessary tool and fast too. I have listed this commands and i believe this should be useful to lots of system admins
Taking Database Backup
mysqldump -uuser -pmysqluserpassword database_name > database_name.sql
Restoring a Database
mysql -uuser -pmysqluserpassword database_name < database_name.sql
Here, you need to replace the user with the proper database user who has access to that specific database and the mysqluserpassword directs the password of that specific user. Here, one important thing is database_name.sql file can be replaced with the location of the sql file, suppose if you want to save it or retrieve from /home/backup then you can put /home/backup/database_name.sql to do that.
No comments:
Post a Comment