bin>mysqldump -u root -p 要备份的数据库名>本地保存备份的路径+文件名
bin>mysql -u root -p 要恢复的数据库名<本地保存备份的路径+文件名
对数据库进行备份处理时不用进行登陆:html
mysqldump -u root -p test >c:/test.sql
mysql
enter password : root
sql
这样就能够对数据库 test进行备份 到c盘的test,sql 文件里
数据库
MySQL -u root -p test < c:/test.sql
3d
password root
code
注:恢复时须要建立一个空的数据库,再次对数据库进行查询时 表格 就会出来
htm