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