View the logs of the mysql container
docker logs -f mysql
Error message: Variables are not bound in the modified configuration file. set GLOBAL MAX_USER_CONNECTIONS = 1000;
Mysql configuration file modification is wrong, you need to delete the Mysql container, recreate the Mysql container, and re-modify the maximum number of connections
delete the mysql container
docker rm -f mysql
After recreating the mysql container,
Enter inside the mirrored mysql container
docker exec -it mysql /bin/bash
Because there is no vim command inside the docker image, it needs to be installed manually, or you can use the docker cp command to copy it from the host
apt-get update
apt-get install vim
edit configuration file
vim /etc/mysql/mysql.conf.d/mysqld.cnf
Add at the end of the file:
max_connections=1024
max_user_connections=1024
Restart the mysql container
docker start mysql
View the running status of the mysql container
docker ps -a
mysql restarted successfully