Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql client 8.0 failed to connect to tidb-server #6942

Closed
lysu opened this issue Jun 29, 2018 · 3 comments · Fixed by #10183
Closed

mysql client 8.0 failed to connect to tidb-server #6942

lysu opened this issue Jun 29, 2018 · 3 comments · Fixed by #10183

Comments

@lysu
Copy link
Collaborator

lysu commented Jun 29, 2018

  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.

@breezewish
Copy link
Member

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

@lysu
Copy link
Collaborator Author

lysu commented Jul 2, 2018

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.

@fkpwolf
Copy link

fkpwolf commented Apr 8, 2019

For MySql Workbench 8.0, there is no way to change character-set. Have to switch to Sequel Pro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants