Home >Database >Mysql Tutorial >sql文件导入导出乱码解决_MySQL

sql文件导入导出乱码解决_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:28:481566browse

bitsCN.com

sql文件导入导出乱码解决

 

今天从windows上导出一个sql执行文件,再倒入到unbutn中,结果出现乱码, 

解决方式 

 

在导出mysql sql执行文件的时候,指定一下编码格式: 

 

代码如下:

 

mysqldump -uroot -p --default-character-set=utf8 mo(dbname) > E://xxxx.sql 

 

 

导入的时候OK了 

 

执行如下 

 

代码如下:

 

mysql -u root -p --default-character-set=utf8 use dbname source /root/newsdata.sql 

 


bitsCN.com
Statement:
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