use mysql 8.0 client.
➜ ./bin/mysql -h 127.0.0.1 -P 4000 -u root
ERROR 1105 (HY000): Unknown charset id 255
➜ ./bin/mysql -V
./bin/mysql Ver 8.0.11 for osx10.13 on x86_64 (Source distribution)
connected
ERROR 1105 (HY000): Unknown charset id 255
tidb-server -V or run select tidb_version(); on TiDB)?Release Version: v2.1.0-alpha-89-g0547af60a
Git Commit Hash: 0547af60af60d16e262208ca0684e771386f62eb
Git Branch: dev-fix-maria-db-client
UTC Build Time: 2018-06-28 03:21:07
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
This issue is related with 8.0 new collation.
before we fix it, the user can add --default-character-set utf8when use MySQL 8.0 client to bypass this problem.
hint: it should be --default-character-set in mysql Ver 8.0.11.
IMHO, current the handling logic of TiDB is more right than MySQL does, and we should not change this logic in current stage.
In MySQL, use client-5.7 will forward compatible with server-8.0 like this. it will slient make collation be the global_system_variables's values, and user know nothing about this, they will still think everything is well but use collation which they doesn't wanted, I think it's very dangerous.
So, we should NOT forward compatible with 8.0's new utf8mb4_0900_ai_ci and keep return error to make user know collaction question until we support unicode9.0 in TiDB.
When meet this error, we can
--default-character-set utf8 to mysql-client 8.0's arguments /etc/mysql/mysql.cnf or /etc/mysql/conf.d/mysql.conf set mysql.default-character-set=utf8and we will support unicode 9.0 in future.
For MySql Workbench 8.0, there is no way to change character-set. Have to switch to Sequel Pro.
Most helpful comment
hint: it should be
--default-character-setin mysql Ver 8.0.11.