MySQL ODBC 3.51 Driver UTF-8 encoding

怎甘沉沦 提交于 2019-12-17 20:39:52

问题


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.


回答1:


According to this you can make it work by setting the DNS's 'Connect Options'->'Initial Statement' to 'SET NAMES utf8'.




回答2:


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.



来源:https://stackoverflow.com/questions/1000636/mysql-odbc-3-51-driver-utf-8-encoding

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!