MySQL ODBC 3.51 驱动程序 UTF-8 编码
目前我正在将 MSSQL 迁移到 MySQL。 我正在使用 MySQL ODBC 3.51 驱动程序通过 ODBC 连接来连接到 MySQL。 我在表中存储了泰卢固语字符。 使用 MySQL ODBC 驱动程序时它们无法正确显示,但使用 sqlserver ODBC 驱动程序时它们可以正确显示。
我的连接字符串是
Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=dbtest; User=user1;Password=mysql;Option=3;CharSet=utf8;
请建议一个解决方案来解决此问题。
Currently I am migrating MSSQL to MySQL. I am using the MySQL ODBC 3.51 driver to connect to MySQL using ODBC connectivity. I have Telugu language characters stored in the table. They are not showing properly while using the MySQL ODBC driver, but they are showing up properly while using the sqlserver ODBC driver.
My connection string is
Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=dbtest; User=user1;Password=mysql;Option=3;CharSet=utf8;
Please suggest a solution to fix this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 this 你可以通过设置 DNS 来使其工作将“连接选项”->“初始语句”设置为“SET NAMES utf8”。
According to this you can make it work by setting the DNS's 'Connect Options'->'Initial Statement' to 'SET NAMES utf8'.
我遇到了类似的问题。 除了上面的答案之外,我还可以通过将数据库列中的字符集更改为 ASCII 或 Latin1 来正确传输数据。 我相信 ODBC 不会转换编码,这可能导致与数据库不匹配。
I was experiencing a similar issue. In addition to answer above, I was also able to get the data to transfer properly by changing the character set in the column of my database to either ASCII or Latin1. I believe ODBC will not convert encoding which can result in mismatches with the database.