“基于Alpine的mysql Docker镜像”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
第37行: 第37行:
 
[https://segmentfault.com/q/1010000003840346 Docker:无法连接容器中的mysql]
 
[https://segmentfault.com/q/1010000003840346 Docker:无法连接容器中的mysql]
  
 +
https://stackoverflow.com/questions/56580412/mysql-installation-for-alpine-linux-in-docker/68830928#68830928
  
 
[https://serverfault.com/questions/616696/lost-connection-to-mysql-server-at-reading-initial-communication-packet-syste Lost connection to MySQL server at 'reading initial communication packet', system error: 0 ]
 
[https://serverfault.com/questions/616696/lost-connection-to-mysql-server-at-reading-initial-communication-packet-syste Lost connection to MySQL server at 'reading initial communication packet', system error: 0 ]
  
 
[[category:devops]]  [[category:Container]]
 
[[category:devops]]  [[category:Container]]

2021年8月18日 (三) 10:47的版本

==


see also

类似的参考 https://github.com/yobasystems/alpine-mariadb/blob/master/alpine-mariadb-amd64/Dockerfile


mysql配置文件生效测试

trouble shooting

 van@myxps:~$ mysql -uroot -p -h127.0.0.1 
Enter password: 
ERROR 2013 (HY000): Lost connection to MySQL server at 'handshake: reading initial communication packet', system error: 11


解决办法 注释掉这行  skip-networking      跳过TCP/IP连接
cat /etc/my.cnf.d/mariadb-server.cnf

[mysqld]
#skip-networking


处理过程  其实一开始telent 3306不通就差不多是网络问题啦 , 因为容器里面是可用的 

别人的解决办法 我也记录一下 虽然和我的不同 

1、将 /etc/my.cnf 中的bind-address参数修改成0.0.0.0,表示允许任何ip主机访问此数据库
and 
skip-name-resolve


Docker:无法连接容器中的mysql

https://stackoverflow.com/questions/56580412/mysql-installation-for-alpine-linux-in-docker/68830928#68830928

Lost connection to MySQL server at 'reading initial communication packet', system error: 0