mysql备份数据库的命令

 

上干货:

备份库:(注意这里直接备份是默认加了锁的,生产环境这样会有事故的啊)

Mysqldump -u root -p --tab=/backup sales

恢复操作:

方法一: shell$ mysql -u root -p sales < /backup/orders.sql

   Shell$mysqlimport -u root -p --local sales /backup/orders.txt

方法二: mysql> use sales

  Mysql>source /backup/orders.sql

  Mysql>load data local infile ‘/backup/orders.txt’ into table orders

 

扩展:

which mysqldump command argument is used to dump only data from the userdata table.

--no-create-info to skip writing CREATE TABLE statements

 

===============End,=================

上一篇:C#的"闭包"


下一篇:快速排序。