Home > Database > Mysql Tutorial > body text

mysql从执行.sql文件时处理/n换行的问题_MySQL

WBOY
Release: 2016-06-01 13:19:21
Original
987 people have browsed it

bitsCN.com 在备份数据库的时候,数据表中可能存在这样的值array('a'='b',
'c'='d')
这种格式的值。而在数据导出的时候 会将换行换成/n(windows下是这样,unix下可能是另一种符号)。而当在回复数据的时候,如果用mysql -h localhost -u root -proot
后来注意到,在上面我们恢复数据的时候是在没有连接数据的状态下执行的。那么,我们先连接数据库,即先执行mysql -h localhost -u root -proot 进入到数据库,然后在数据库连接成功的状态下 再执行mysql> source path/*.sql;语句,ok,数据导入成功。
bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!