mysql中备份数据库的方式是什么

mysql中备份数据库的方式是什么

这篇文章将为大家详细讲解有关mysql中备份数据库的方式是什么,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

1、备份所有数据库:

shell>mysqldump -uroot -p --all-database > all.sql

2、备份数据库 test

shell>mysqldump -uroot -p test > test.sql

3、备份数据库 test 下的表 emp

shell> mysqldump -uroot -p test emp > emp.sql

4、备份数据库test下的表emp和dept

shell> mysqldump -uroot -p test emp dept > emp_dept.sql

5、备份数据库test 下的所有表为逗号分割的文本,备份到 /tmp:

shell> mysqlddump -uroot -p -T /tmp test emp --fields-terminated-by ','
shell> more emp.txt  
 
1,z1
2,z2
3,z3
4,z4

关于“mysql中备份数据库的方式是什么”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。