[u]http://www.21andy.com/blog/20071102/655.html[/u]
[b]备份MySQL数据库的命令[/b]
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
[b]备份MySQL数据库为带删除表的格式[/b]
mysqldump -–add-drop-table -uusername -ppassword databasename > backupfile.sql
[b]直接将MySQL数据库压缩备份[/b]
mysqldump -hhostname -uusername -ppassword databasename | gzip > backupfile.sql.gz
[b]备份MySQL数据库某个(些)表[/b]
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 > backupfile.sql
[b]同时备份多个MySQL数据库[/b]
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 > multibackupfile.sql
[b]仅仅备份数据库结构[/b]
mysqldump –no-data –databases databasename1 databasename2 databasename3 > structurebackupfile.sql
[b]备份服务器上所有数据库[/b]
mysqldump –all-databases > allbackupfile.sql
[b]还原MySQL数据库的命令[/b]
mysql -hhostname -uusername -ppassword databasename < backupfile.sql
[b]还原压缩的MySQL数据库[/b]
gunzip < backupfile.sql.gz | mysql -uusername -ppassword databasename
[b]将数据库转移到新服务器[/b]
mysqldump -uusername -ppassword databasename | mysql –host=*.*.*.* -C databasename
[b]备份MySQL数据库的命令[/b]
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
[b]备份MySQL数据库为带删除表的格式[/b]
mysqldump -–add-drop-table -uusername -ppassword databasename > backupfile.sql
[b]直接将MySQL数据库压缩备份[/b]
mysqldump -hhostname -uusername -ppassword databasename | gzip > backupfile.sql.gz
[b]备份MySQL数据库某个(些)表[/b]
mysqldump -hhostname -uusername -ppassword databasename specific_table1 specific_table2 > backupfile.sql
[b]同时备份多个MySQL数据库[/b]
mysqldump -hhostname -uusername -ppassword –databases databasename1 databasename2 databasename3 > multibackupfile.sql
[b]仅仅备份数据库结构[/b]
mysqldump –no-data –databases databasename1 databasename2 databasename3 > structurebackupfile.sql
[b]备份服务器上所有数据库[/b]
mysqldump –all-databases > allbackupfile.sql
[b]还原MySQL数据库的命令[/b]
mysql -hhostname -uusername -ppassword databasename < backupfile.sql
[b]还原压缩的MySQL数据库[/b]
gunzip < backupfile.sql.gz | mysql -uusername -ppassword databasename
[b]将数据库转移到新服务器[/b]
mysqldump -uusername -ppassword databasename | mysql –host=*.*.*.* -C databasename