Docker之中mysql链接报错
程序员文章站
2022-06-13 16:13:09
...
Client does not support authentication protocol requested by server;
consider upgrading MySQL client
[root@node1 gaojs]# cat start
#!/bin/bash
docker run --name mysqldb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql
[root@node1 gaojs]# mv start docker_mysql
[root@node1 gaojs]# clear
[root@node1 gaojs]# chmod 777 docker_mysql
[root@node1 gaojs]# clear
[root@node1 gaojs]# ls
apache-hive-2.3.9-bin.tar.gz docker_mysql Downloads hadoop-2.8.1.tar.gz jdk-linux-x64.tar.gz Pictures Templates
Desktop Documents hadoop2.8.1 jdk1.8.0_131 Music Public Videos
[root@node1 gaojs]# sh docker_mysql
385d2e8747de4e07827c571f9605c579d028207c944c723b288b190bd3ad1c01
[root@node1 gaojs]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
385d2e8747de mysql "docker-entrypoint..." 7 minutes ago Up 7 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysqldb
[root@node1 gaojs]# docker exec -it 385d2e8747de /bin/bash
root@385d2e8747de:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.25 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
5 rows in set (0.05 sec)
mysql> select host,user,plugin,authentication_string from mysql.user;
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| host | user | plugin | authentication_string |
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| % | root | caching_sha2_password | $A$005$wTf<wF
NIQr)wjC\DEQQjjFLBE/0cxRp.d//.S9Tel.qsQUe9bW5KPqx8k. |
| localhost | mysql.infoschema | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.session | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.sys | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | root | caching_sha2_password | $A$005$e.+czYXFnFqm xrFumAQrIMlZayXjJJQvJSlexMsEjw2fK7EljgXSwO6 |
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
5 rows in set (0.09 sec)
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
Query OK, 0 rows affected (0.06 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
mysql>
推荐阅读
-
nacos 1.2x 链接mysql8.0版本报错解决
-
IDEA链接MySQL报错08001和连接成功后不显示表的问题及解决方法
-
centos下docker运行容器mysql报错runc: symbol lookup error: runc: undefined symbol: seccomp_api_get
-
Docker之中mysql链接报错
-
MySql 链接报错“Client does not support authentication protocol requested by server; consider upgradin”
-
express链接mySQL报错Client does not support authentication protocol requested by server; consider upgrad
-
jdbc-ecplise链接mysql报错
-
Navicat 远程连接docker容器中的mysql 报错1251 - Client does not support authentication protocol 解决办法
-
jdbc-ecplise链接mysql报错
-
报错-nodejs链接mysql数据库错误