Home > Database > Mysql Tutorial > MySQL导入时出现unknown command的解决方案_MySQL

MySQL导入时出现unknown command的解决方案_MySQL

WBOY
Release: 2016-06-01 13:44:07
Original
2153 people have browsed it

bitsCN.com 今天想把远程MySQL服务器上的一张表导入到本地数据库,于是先使用mysqldump导出这张表,这是很容易的,轻松搞定。但是导入的时候就不行了,总是提示Unknown command ‘//’。一开始还以为这是mysql的bug,自己导出的东西自己不能导入,后来想想MySQL不应该这么弱的,就上网搜了一下,结果发现是默认字符集的问题。远程的数据库服务器操作系统是Linux,OS的默认字符集也是UTF-8,但是我本机用的是Windows 7,默认的字符集是GBK,在导入的时候加上–default-characgter-set=utf8就好了。最后附上完整的导入导出语句
 
mysqldump -udbuser -p database table > exp.sql;
 
mysql -udbuser -p –default-character-set=utf8 database   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