MySQL Backup Recovery "fault" Summary

Source: Internet
Author: User

Back up data from host A to host B

Mysqldump-uroot-p vw> vw. SQL

Back up the database file and restore it to the target machine B. The database version of B is 5.5.23, And the mysql version of machine A is 5.0.22.

  1. Mysql> source/root/vw. SQL;
  2. ............................................................
  3. Query OK, 6748 rows affected (0.13 sec)
  4. Records: 6748 Duplicates: 0 Warnings: 0
  5. Query OK, 6807 rows affected (0.12 sec)
  6. Records: 6807 Duplicates: 0 Warnings: 0
  7. Query OK, 6752 rows affected (0.13 sec)
  8. Records: 6752 Duplicates: 0 Warnings: 0
  9. Query OK, 6659 rows affected (0.13 sec)
  10. Records: 6659 Duplicates: 0 Warnings: 0
  11. Query OK, 6676 rows affected (0.13 sec)
  12. Records: 6676 Duplicates: 0 Warnings: 0
  13. Query OK, 6583 rows affected (0.12 sec)
  14. Records: 6583 Duplicates: 0 Warnings: 0
  15. Query OK, 6598 rows affected (0.13 sec)
  16. Records: 6598 Duplicates: 0 Warnings: 0
  17. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''at line 1
  18. Mysql>

The above error occurs when you import data on machine B to exclude the database itself. Later, you used the navicat tool to back up data of machine A and then imported the data to machine B again.

It was found that it was caused by character set problems. The solution is as follows:

Back up the data on machine A and run the following command to restore the data to machine B and test OK.

 
 
  1. mysqldump -uroot --default-character-set=utf8  -p vw>vw.sql
  • 1
  • 2
  • 3
  • 4
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.