I will try to cover all possible methods to take backup and restore backup using mysqldump utility.
How to take database backup using mysqldump
mysqldump -u[username] -p[password] [database name] > dum_file_name.sql
e.g
mysqldump -uroot -ppassword mysql > mysql.sql
How to take backup of multiple databases at the same time
mysqldump -u[username] -p[password] [database 1 name]..[database 2 name]
e.g
mysql -uroot -ppassword DB1 DB2 DB3
How to take backup all the databases
mysqldump -u[username] -p[password] -all-databases > [dumpfile.sql]
How to take backup of specific table of a database
mysqldump -u[username] -p[password] [database name] [table Name] > dumpFIle.sql
e.g.
mysqldump -uroot -ppassword mysql user > user.sql
How to backup of table structures:
mysqldump -d -uroot -ppassword database01 > dumpfile.sql
How to restore backup
Database backup can be restored using mysqldump as well as mysql command.
mysql -u[user] -p[password] database name < dumpfile.sql
e.g.
mysql -uroot -ppassword mysql < mysql.sql
I hope you find this article helpful.
Suggestions are always welcome :)
Monday, August 23, 2010
Thursday, August 5, 2010
500 OOPS: cannot locate user entry:nobody
While routine examination I saw a process running on server of user nobody. I thought this user is suspicious so I killed all the processes of this user (pkill -u nobody) and then deleted the user using command (userdel -r nobody) however delete command gave me error userdel: / not owned by nobody, not removing. Due to this people are unable to connect to my server through FTP and when they try they get error like 500 OOPS: cannot locate user entry:nobody.
How to Fix: Just all add "ftp_username=nobody" in /etc/vsftp.conf. Then restart vsftpd service (service vsftpd restart).
Enjoy :)
How to Fix: Just all add "ftp_username=nobody" in /etc/vsftp.conf. Then restart vsftpd service (service vsftpd restart).
Enjoy :)
Subscribe to:
Posts (Atom)