我有这样一批:
mysql.exe -h -u -p data_base < D:\data_base.dat
在这个 data_base.bat 中我有一个查询。此查询创建一个表,如下所示:
CREATE TABLE table_name(
select *
from a
where a.1 = 'Á'
);
我有 windows server 2008 r2 和 mysql server 5.6 所有数据库和表都在 latin1_swedish_ci 中。
当我运行 de.bat 时出现错误:
错误 1267 非法混合排序规则 (latin1_swedish_ci.IMPLICIT) 和 (cp850_general_ci, COERCIBLE) 用于操作“=”
当我在查询中删除“´”时,它工作正常。
在我看来,这是我的 MySQL 服务器中的 latin1_swedish_ci 和 Windows 中的 cp850_general_ci 之间的冲突。可能吗?
谢谢
最佳答案
是的,我认为您已经确定了问题所在。当您创建批处理文件时,它会使用操作系统的默认字符编码(及其排序规则)进行编码。尝试使用 Notepad++
或任何可让您重新编码为不同字符编码的类似实用程序。
对于 Notepad++,转到
Encoding > Character sets > Western European > Windows-1252
关于批处理文件中的 Mysql 错误 1267,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16366725/