Docker-mysql 外部连接报错(ERROR 2013 (HY000))
错误信息:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
解决
授权远程连接
-
进入 mysql
mysql -h localhost -u root -p
-
授权
mysql 8.0 以下
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
mysql 8.0
grant all privileges on *.* to 'root'@'%' ;
-
刷新权限
flush privileges;