Mysql handles \ line-wrapping problems when executing. sql files _mysql
Source: Internet
Author: User
There may be such a value array (' A ' = ' B ') in the datasheet when the database is backed up.
' C ' = ' d ')
The value of this format. When the data is exported, the newline is changed to \ n (this is the case under Windows, which may be another symbol under UNIX). When replying to the data, if the mysql-h localhost-u Root-proot < Path/*.sql is restored, the database reports an error prompt that "does not recognize the \ n" character, thus terminating the operation. Think for a long time, it is in the data export when there is an option to prevent the conversion of lines to "\ n", looked at all mysqldump options, did not find a solution to the answer. The problem is when you are importing data.
It was later noted that when we recovered the data, it was performed in a state where no data was connected. So, we first connect to the database, that is, execute mysql-h localhost-u root-proot into the database, and then execute the mysql> source Path/*.sql when the database connection is successful, the statement, OK, the data import is successful.
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.