Error analysis during data import using MySQL5.6

Source: Internet
Author: User

Error analysis during data import using MySQL5.6

A strange error occurred when importing data exported by mysqldump today?

ERROR 1064 (42000) at line 13327: 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

Open row 13327 of the file and find that this is the SQL statement of a trigger /*! * I think triggers fails to be created.
However, this is true for manual execution:

Mysql> /*! 50003 CREATE *//*! 50017 DEFINER = 'appuser' @ '% '*//*! 50003 TRIGGER 'B _ admin_user_update' after update on 'B _ admin_user' FOR EACH ROW
-> Insert into delta_ B _admin_user ('user _ id', 'username', 'Password', 'salt', 'real _ name', 'cell _ phone', 'qq ', 'phone', 'email ', 'wangwang', 'created _ time', 'last _ login_time', 'last _ login_ip ', 'user _ group_id', 'flag ', 'parent _ id', 'qr _ Code ')
-> Values
-> (NEW. user_id, NEW. username, NEW. password, NEW. salt, NEW. real_name, NEW. cell_phone, NEW. qq, NEW. phone, NEW. email, NEW. wangwang, NEW. created_time, NEW. last_login_time, NEW. last_login_ip, NEW. user_group_id, NEW. flag, NEW. parent_id, NEW. qr_code );*/;;
Query OK, 0 rows affected (0.01 sec)

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

Is the execution successful? But an error is reported :(

After searching, it is found that mysql has a parameter during the import, that is, ignore the error and continue to execute the following SQL statement, knowing that the entire file is successfully executed.

-- Force: this parameter is added and imported again.

/Usr/local/mysql-5.6/bin/mysql-uroot-p 'pass' -- force </usr/local/mysql-5.6/all. SQL
Warning: Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 13327: 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
ERROR 1064 (42000) at line 13345: 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
ERROR 1064 (42000) at line 15612: 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
ERROR 1064 (42000) at line 15630: 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
ERROR 1064 (42000) at line 21753: 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
ERROR 1064 (42000) at line 21771: 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
ERROR 1064 (42000) at line 28734: 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

Well, I did not quit.
Then I did another test.
If you do not export a trigger when exporting data, you must add the -- skip-triggers parameter.

No error is reported during the import.
So is it the relationship between the mysql-5.6 version?
To be studied

This article permanently updates the link address:

Related Article

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.