错误“客户端不支持源字符集"当字段设置为 uft8mb4_general_ci

2022-01-15 00:00:00 character odbc mariadb mysql

此错误是 Windows MariaDB 驱动程序问题吗?

Is this error a Windows MariaDB driver issue?

[MySQL][ODBC 5.1 Driver][mysqld-5.5.5-10.2.12-MariaDB]客户端不支持源字符集

[MySQL][ODBC 5.1 Driver][mysqld-5.5.5-10.2.12-MariaDB]Source character set not supported by client

尝试使用此 asp 代码进行连接时,我不断收到错误消息:

I keep getting the error when trying to connect using this asp code:

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = Connection_STRING
rs.Source = "SELECT * FROM mytable WHERE text-str = 'some text'
rs.CursorType = 1
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
if (rsL.EOF) then
    ...
end if
rs.Close()
Set rs = Nothing

推荐答案

只是将text-str数据类型从VARCHAR改为TEXT 事情开始奏效了.

It was only after changing text-str datatype form VARCHAR to TEXT that things started to work.

但一段时间后,我发现我无法从表格中获取任何文本.我可以保存到它,但不能取回它.

But some time later I found that I couldn't get any text from the table. I could save to it, but not get it back.

经过一番搜索,我终于能够通过将字段的默认排序规则从 uft8mb4_general_ci 更改为 uft8_general_ci 来解决错误.现在 VARCHAR 也可以使用了.

After some more searching, I was finally able to resolve the error by changing the field's default collation from uft8mb4_general_ci to uft8_general_ci. And now VARCHAR also works.

我在更新/删除 Wordpress 插件后开始的错误.不知何故,这改变了数据库的一些默认设置,我连接到它的方式不再起作用.

The error I started after a Wordpress plugin update/removal. Somehow this changed some default settings to the database, and the way I was connecting to it was not working any more.

安装更新的 ODBC 驱动程序解决了它.

Installing an updated ODBC driver solved it.

相关文章