MySQL日志:
2024-10-29T08:56:47.224252Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2024-10-29T08:56:47.224253Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2024-10-29T08:56:47.224919Z 0 [Warning] CA certificate ca.pem is self signed.
2024-10-29T08:56:47.224954Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2024-10-29T08:56:47.225224Z 0 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
2024-10-29T08:56:47.225280Z 0 [Note] - '0.0.0.0' resolves to '0.0.0.0';
2024-10-29T08:56:47.225303Z 0 [Note] Server socket created on IP: '0.0.0.0'.
2024-10-29T08:56:47.225940Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2024-10-29T08:56:47.233149Z 0 [Note] Event Scheduler: Loaded 0 events
2024-10-29T08:56:47.233335Z 0 [Note] mysqld: ready for connections.
Version: '5.7.44' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
2024-10-29T08:57:16.488658Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2024-10-29T08:57:16.776737Z 3 [Note] Access denied for user 'root'@'ops_web.docker_default' (using password: NO)
2024-10-29T08:57:46.573563Z 16 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2024-10-29T08:58:16.622975Z 28 [Note] Access denied for user 'root'@'localhost' (using password: NO)
只是修改了密码,MySQL容器进入后本地可以正常登录,但是远程访问报错,my.cnf中添加bind-address=0.0.0.0 和重新给用户授权也不行。
docker-compose.yml MySQL配置: services: mysql: image: mysql:5.7 container_name: mysql-ops environment:
MySQL日志: 2024-10-29T08:56:47.224252Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher. 2024-10-29T08:56:47.224253Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher. 2024-10-29T08:56:47.224919Z 0 [Warning] CA certificate ca.pem is self signed. 2024-10-29T08:56:47.224954Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory. 2024-10-29T08:56:47.225224Z 0 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 2024-10-29T08:56:47.225280Z 0 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 2024-10-29T08:56:47.225303Z 0 [Note] Server socket created on IP: '0.0.0.0'. 2024-10-29T08:56:47.225940Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2024-10-29T08:56:47.233149Z 0 [Note] Event Scheduler: Loaded 0 events 2024-10-29T08:56:47.233335Z 0 [Note] mysqld: ready for connections. Version: '5.7.44' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) 2024-10-29T08:57:16.488658Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO) 2024-10-29T08:57:16.776737Z 3 [Note] Access denied for user 'root'@'ops_web.docker_default' (using password: NO) 2024-10-29T08:57:46.573563Z 16 [Note] Access denied for user 'root'@'localhost' (using password: NO) 2024-10-29T08:58:16.622975Z 28 [Note] Access denied for user 'root'@'localhost' (using password: NO)