You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,26 @@ MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not speci
33
33
MYSQL_USER=your_username
34
34
MYSQL_PASSWORD=your_password
35
35
MYSQL_DATABASE=your_database
36
+
37
+
# Optional: Charset and collation settings for compatibility with older MySQL versions
38
+
MYSQL_CHARSET=utf8mb4 # Optional: Character set (defaults to utf8mb4)
39
+
MYSQL_COLLATION=utf8mb4_unicode_ci # Optional: Collation (defaults to utf8mb4_unicode_ci)
40
+
MYSQL_SQL_MODE=TRADITIONAL # Optional: SQL mode (defaults to TRADITIONAL)
41
+
```
42
+
43
+
### Troubleshooting Collation Issues
44
+
If you encounter the error "Unknown collation: 'utf8mb4_0900_ai_ci'", this typically means you're connecting to an older MySQL version (5.7 or earlier) that doesn't support the newer collation. The server now automatically uses compatible settings, but you can override them:
45
+
46
+
For MySQL 5.7 and earlier:
47
+
```bash
48
+
MYSQL_CHARSET=utf8mb4
49
+
MYSQL_COLLATION=utf8mb4_unicode_ci
50
+
```
51
+
52
+
For very old MySQL versions (5.6 and earlier):
53
+
```bash
54
+
MYSQL_CHARSET=utf8
55
+
MYSQL_COLLATION=utf8_unicode_ci
36
56
```
37
57
38
58
## Usage
@@ -44,7 +64,7 @@ Add this to your `claude_desktop_config.json`:
44
64
"mysql": {
45
65
"command": "uv",
46
66
"args": [
47
-
"--directory",
67
+
"--directory",
48
68
"path/to/mysql_mcp_server",
49
69
"run",
50
70
"mysql_mcp_server"
@@ -55,6 +75,9 @@ Add this to your `claude_desktop_config.json`:
55
75
"MYSQL_USER": "your_username",
56
76
"MYSQL_PASSWORD": "your_password",
57
77
"MYSQL_DATABASE": "your_database"
78
+
// Optional: Add these if you encounter collation issues
79
+
// "MYSQL_CHARSET": "utf8mb4",
80
+
// "MYSQL_COLLATION": "utf8mb4_unicode_ci"
58
81
}
59
82
}
60
83
}
@@ -80,6 +103,9 @@ Add this to your `mcp.json`:
80
103
"MYSQL_USER": "your_username",
81
104
"MYSQL_PASSWORD": "your_password",
82
105
"MYSQL_DATABASE": "your_database"
106
+
// Optional: Add these if you encounter collation issues
0 commit comments