mysql資料庫資料備份與恢複

來源:互聯網
上載者:User

標籤:server   enter   file   class   loading   load   war   select   rom   

備份資料:

C:\Users\Administrator>mysqldump -uroot --password -v test01 test02 >e:\temp\20170507\a3.sqlEnter password: ****-- Connecting to localhost...-- Retrieving table structure for table test02...-- Sending SELECT query...-- Retrieving rows...-- Disconnecting from localhost...
mysql> use test01;Database changedmysql> select * from test02 into outfile ‘e:\temp\20170507\a5.sql‘    -> ;ERROR 1 (HY000): Can‘t create/write to file ‘e: emp20170507a5.sql‘ (Errcode: 2 - No such file or directory)mysql> select * from test02 into outfile ‘e:/temp/20170507/a5.sql‘;Query OK, 8 rows affected (0.00 sec)

 恢複資料:

使用load data方法

mysql> load data infile ‘e:/temp/20170507/a5.sql‘ into table test03;Query OK, 8 rows affected (0.03 sec)Records: 8  Deleted: 0  Skipped: 0  Warnings: 0

使用mysqlimport方法

C:\Users\Administrator>mysqlimport --user root --password -v test01 e:/temp/20170507/test03.sqlEnter password: ****Connecting to localhostSelecting database test01Loading data from SERVER file: e:/temp/20170507/test03.sql into test03test01.test03: Records: 8  Deleted: 0  Skipped: 0  Warnings: 0Disconnecting from localhost

 

mysql資料庫資料備份與恢複

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.