Closed Icemap closed 2 weeks ago
@leobeijing2000 @lastincisor PTAL
mysql used "caching_sha2_password" create user is ok
CREATE USER 'song1'@'%' IDENTIFIED WITH caching_sha2_password BY '123456';
use "mysql cli" login is ok。
mysql -usong1 -p
tidb used "caching_sha2_password" create user is ok
CREATE USER 'song1'@'%' IDENTIFIED WITH caching_sha2_password BY '123456';
use "mysql cli" login is error.
mysql -usong1 -hxxx.xxx.xxx.xxx -Pxxxx -p
error info
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
bug not used jdbc.
@Icemap
error info ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure >connection.
@lastincisor @Icemap
Did you have the 'SSL' enabled for TiDB? According to the manual, the connection should be encrypted for caching_sha2_password
authentication, you could verify it by using:
select @@have_ssl;
Note that MySQL does caching. So after the connection succeeds once over a secure connection subsequent connections can be established over insecure connections. The cache is only in memory so after a MySQL restart it will require a secure connection again. TiDB currently always requires a secure connection.
I think we could:
caching_sha2_password
.Note that MySQL does caching. So after the connection succeeds once over a secure connection subsequent connections can be established over insecure connections. The cache is only in memory so after a MySQL restart it will require a secure connection again. TiDB currently always requires a secure connection.
I think we could:
1. Close this as not-a-bug. 2. Change this to a feature request for the caching part of `caching_sha2_password`.
With https://github.com/pingcap/tidb/issues/56747 I think we should go for option 1.
Got it. Thanks for helping.
Bug Report
I used
CREATE USER 'username' IDENTIFIED WITH caching_sha2_password
statement to create a user. MySQL can use this user login, but TiDB would not.1. Minimal reproduce step (Required)
caching_sha2_password
AuthPlugin)mvn clean package && java -jar target/tidb-java-gitpod-0.0.1-jar-with-dependencies.jar
JDBC URL
to MySQL hostmvn clean package && java -jar target/tidb-java-gitpod-0.0.1-jar-with-dependencies.jar
caching_sha2_password
user2. What did you expect to see? (Required)
Java code gets the connection and output result of
SELECT CURRENT_USER()
when linked MySQL:3. What did you see instead (Required)
Java code can not get the connection and print error stack when linked TiDB:
4. What is your TiDB version? (Required)