MySQL ODBC 3.51 驱动程序 UTF-8 编码

发布于 2024-07-23 15:28:28 字数 346 浏览 1 评论 0原文

目前我正在将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三生路 2024-07-30 15:28:28

根据 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'.

吝吻 2024-07-30 15:28:28

我遇到了类似的问题。 除了上面的答案之外,我还可以通过将数据库列中的字符集更改为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文