Home > Database > Mysql Tutorial > body text

mysql使用source 命令乱码问题解决方法_MySQL

WBOY
Release: 2016-06-01 13:24:07
Original
1210 people have browsed it

bitsCN.com 今天从windows上导出一个sql执行文件,再倒入到unbutn中,结果出现乱码,折腾7-8分钟,
解决方式
在导出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

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!