解决办法: docker exec -it dc10e8b328d7 bashmysql -u root -p 输入密码 use mysql; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; //123456为密码…
如下所示,PHP连接MySQL报错: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' (2) 测试代码如下: <?php try { $dsn = 'mysql:dbname=php-note;host=localhost;port=3306;charset=utf8'; $username = 'root'; $password = 'root'; new PDO( $dsn,…
Navicat连接Mysql报错:Client does not support authentication protocol requested by server: 刚安装Mysql,想用Navicat去连接,然后就报错了,此处记录报错解决. Navicat连接MySQL Server8.0版本时出现Client does not support authentication protocol requested by server:解决如下: 命令如下: 1.use mysql; 2.…
Navicat 连接远程数据库报错:1130 - Host "XX.XX.XX.XX" is not allowed to connect to this MySQL server 1.连接服务器: mysql -u root -p 2.看当前所有数据库: show databases; 3.进入mysql数据库: use mysql; 4.查看mysql数据库中所有的表: show tables; 5.查看 user 表中的数据: select Host, User from use…
Navicat 连接远程数据库报错:2003 - Can‘’t connect to MySQL server on '172.22.69.190' (10061) 一.原因 远程数据库使用了默认设置,绑定的IP是127.0.0.1 二.解决方案 1.修改 远程服务器的配置 vim /etc/mysql/mysql.conf.d/mysqld.cnf 将 bind-address = 127.0.0.1 改成 bind-address = 0.0.0.0 2.重启 mysql 服务 servi…