http://www.chinaitlab.com/www/special/mysql.asphttp://tech.ccidnet.com/pub/column/c1108.htmlhttp://bbs.caoyuan.net/viewtopic.php?t=2030&view=previous MySQL管理员指南
mysql 数据备份和恢复方法mysqldump 备份整个数据库mysqldump -u root -ppassword databasename >data.sql备份某个或多个表mysqldump -u root -ppassword databasename table1name table2name >data.sql只备份数据结构mysqldump -u root -ppassword databasename --no-data >data.sql恢复mysql -u root -ppassword --database=databasename <data.sql
mysql备份恢复备份:/usr/local/mysql/bin/mysqldump --add-drop-table --all-databases --opt -f -uroot -pabc > /back/mysql-back.sqltar czvf /back/mysql-back.tgz /back/mysql-back.sql//整个数据库
/usr/local/mysql/bin/mysqldump --add-drop-table --opt -f -uroot -p123 ywrc > /home/back/www/ywrc.sqltar czvf /home/back/www/tar/ywrc-back.tgz /home/back/www/ywrc.sql//单个数据库
恢复mysql ywrc < ywrc.sql
%mysqldump samp_db >/usr/archives/mysql/samp_db.1999-10-02 %mysqldump samp_db | gzip >/usr/archives/mysql/samp_db.1999-10-02.gz%mysqldump samp_db student score event absence >grapbook.sql %mysqldump samp_db member president >hist-league.sql %mysqladmin -h boa.snake.net create samp_db %mysqldump samp_db | mysql -h boa.snake.net samp_db %mysqldump --add-drop-table samp_db | mysql -h boa.snake.net samp_db % ls -t -r -1 update.[0-9]* | xargs cat | mysql --one-database db_name %mysql --one-database db_name < update.392 %mysql --one-database db_name < update.393