Tidb: mysql client 8.0 failed to connect to tidb-server

Created on 29 Jun 2018  Â·  3Comments  Â·  Source: pingcap/tidb

  1. What did you do?
    If possible, provide a recipe for reproducing the error.

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)
  1. What did you expect to see?

connected

  1. What did you see instead?

ERROR 1105 (HY000): Unknown charset id 255

  1. What version of TiDB are you using (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.

componenmysql-protocol statuTODO

Most helpful comment

hint: it should be --default-character-set in mysql Ver 8.0.11.

All 3 comments

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

  1. add --default-character-set utf8 to mysql-client 8.0's arguments
  2. modify /etc/mysql/mysql.cnf or /etc/mysql/conf.d/mysql.conf set mysql.default-character-set=utf8

and 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tsthght picture tsthght  Â·  3Comments

breeswish picture breeswish  Â·  3Comments

secmask picture secmask  Â·  4Comments

wjhuang2016 picture wjhuang2016  Â·  3Comments

tennix picture tennix  Â·  3Comments