Skip to content

Cannot connect using MySQL client due to error: Illegal mix of collations #5482

@theetrain

Description

@theetrain

Hello,

I typically connect to DoltDB using VSCode SQLTools without issue. Recently, when I connected after a DoltDB upgrade I came across this error:

Request connection/GetChildrenForTreeItemRequest failed with message: ER_UNKNOWN_ERROR: Illegal mix of collations (utf8mb3_general_ci) and (utf8mb4_0900_bin)

I haven't set explicit charsets to my tables and have relied on defaults. In an attempt to overcome this, I deleted my database and set an explicit charset on all my tables, like this formulas table for example:

CREATE TABLE IF NOT EXISTS formulas (
  id INT NOT NULL AUTO_INCREMENT,
  selector json,
  calculation json,
  PRIMARY KEY (id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin;

Despite setting this, the issue persists. Somewhat related, I noticed the following SQL isn't compatible (that or I'm writing it incorrectly):

ALTER TABLE formulas
CHARACTER SET utf8mb4
COLLATE utf8mb4_0900_bin;

I've confirmed this error exists on DoltDB ❌ v0.53.2 and ❌ v0.54.2, and I'm able to connect error-free on ✅ v0.52.10.

My workaround is to shell into my Docker container running dolt and perform queries via dolt sql -q "<query>" that still works.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingintegrationsIssues with tools connecting to/querying DoltsqlIssue with SQL

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions