Home >Database >Mysql Tutorial >mysql使用source命令乱码问题_MySQL

mysql使用source命令乱码问题_MySQL

WBOY
WBOYOriginal
2016-06-01 13:35:151197browse

bitsCN.com

mysql使用source命令乱码问题

 

今天从windows上导出一个sql执行文件,再倒入到unbutn中,结果出现乱码,折腾7-8分钟,

 

解决方式

 

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

 

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

导入的时候OK了

 

执行如下

 

mysql -uroot -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