-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
I'm currently encountering a problem.
I'm using the mysql:latest
image (which should be 9.3.0), and I'm using the following docker-compose.yml
configuration to start my container. At this time, everything is working normally, and my Datagrip can connect properly.
But when I restarted MySQL with docker restart mysql
, I encountered the problem [28000][1045] Access denied for user 'root'@'192.168.137.1' (using password: YES)
. Then, I entered the MySQL container, but I also failed [28000][1045] Access denied for user 'root'@'localhost' (using password: YES)
.I tried the above steps many times, but I encountered the same problem.
But when I switched to mysql:8.3.0
, this problem disappeared.
Here is my docker-compose.yml
:
mysql:
image: mysql:8.3.0
container_name: mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: fUt8uxRCj#^TKoH
TZ: Asia/Shanghai
volumes:
- "./mysql/conf:/etc/mysql/conf.d"
- "./mysql/data:/var/lib/mysql"
- "./mysql/init:/docker-entrypoint-initdb.d"
networks:
network:
ipv4_address: 177.8.0.18
And my .cnf file:
[client]
default_character_set=utf8mb4
[mysql]
default_character_set=utf8mb4
[mysqld]
server-id = 1
log-bin=mysql-bin
binlog_expire_logs_seconds = 2592000
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
max_connections=1000
symbolic-links=0
default-time_zone = '+8:00'
Metadata
Metadata
Assignees
Labels
No labels