Mysql processes/n line breaks when executing the. SQL file _ MySQL

Source: Internet
Author: User
When mysql executes the. SQL file from the. SQL file, the problem of handling n line breaks bitsCN.com may exist in the data table when backing up the database. array ('a' = 'B ',
'C' = 'd ')
Value in this format. During data export, the newline is replaced with/n (in windows, unix may be another symbol ). When you reply to data, if you use mysql-h localhost-u root-proot <path /*. when the SQL statement is restored, the database reports an error message that "cannot recognize"/n "characters, thus terminating the operation. After thinking for a long time, is there an option during data export to prohibit line breaks from being converted to "/n"? after reading all the options of mysqldump, no solution is found. The problem is that data is being imported.

Later, we noticed that when we restored the data above, it was executed in the state of no data connection. Then, we connect to the database first, that is, execute mysql-h localhost-u root-proot to enter the database, and then execute mysql> source path/* when the database connection is successful /*. SQL statement, OK, data imported successfully.
BitsCN.com

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.