MySQL数据库导入错误:ERROR 1064 (42000)
程序员文章站
2022-05-07 20:56:38
...
我在linux下使用mysqldump导出了数据库文件:
mysqldump -uusername -ppassword impact > impact.sql
然后在window系统导入数据库:
mysql -uusername -ppassword impact < impact.sql
结果出错:
ERROR 1064 (42000) at line 275: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘‘Eun-sun Jung’ at line 1
原因:
导入数据时的默认编码与导出文件的默认编码不一致。
解决办法:
加入--default-character-set 选项指定导入字符集【最好在导入和导出时都指定好统一的字符集--default-character-set=utf8】
mysql -uusername -ppassword --default-character-set=utf8 impact < impact.sql
推荐阅读
-
提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'的错误如何解决?
-
MySQL恢复数据库错误ERROR 1166 (42000) at line 10779: Incorrect column name ''
-
MySql数据库的ERROR1044(42000)错误问题解决办法
-
Mysql错误:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
-
MySQL数据库导出与导入及常见错误解决_MySQL
-
mysql数据库错误ERROR 1130:Host '' is not allowed
-
[MySQL 错误]ERROR 1118 (42000): Row size too large. The maxi_MySQL
-
6G数据库的导入 报各种错误的解决办法_MySQL
-
.mysql 数据库导入错误:40101 SET @OLD_CHARACTER_SET_CLIENT=@
-
docker 中的 mysql导入sql脚本时错误指令:Failed to open file "file_name" error 2/error 22