-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart mysql container report error messages: Could not connect to mysql server. Aborting... #16
Comments
@fye can you provide the command sequence to reproduce this? |
Do you mean this: [root@localhost mysql]# docker start confluence-mysql |
@fye the complete I used the following docker run -it --name=mysql \
--env='DB_USER=avatar' --env='DB_PASS=password' --env='DB_NAME=jira,confluence' \
sameersbn/mysql No problems seen with repeatedly running.. docker stop mysql
docker start mysql |
sorry, I misunderstand. This is my command: mkdir -p /opt/mysql/data2 docker run --name confluence-mysql2 -d |
one more descripton: /opt/mysql/data2 directory is the first I created by the following commands:
And then create good container, after running for a period of time, confluence was also produced a lot of data. Server restart after a few days ago, I found that direct execution command:
command, so the error: Could not connect to mysql server. Aborting... Then I try to generate a new container, which is the command:
Also report the error: Could not connect to mysql server. Aborting... |
@fye can you pull down the updated latest tag from the docker and retry docker pull sameersbn/mysql:latest There was one particular use case that was fixed recently. Can you test with the updated image. |
@fye if that does not help, please test after disabling selinux with |
@sameersbn , I found my problems. I use the following command, that is ok:
also works. |
@fye what was the problem? |
@sameersbn , I don't know why, I removed the following args:
|
And i followed your method, include disabled selinux with setenforce 0, that's not ok, same error like before. |
@fye did you try updating the |
@sameersbn , Yes, I had update the image, also the same error. |
@fye got it. |
Got same error
root@pass:/opt/teampass# docker-compose up mysql |
@netflash Looks like you have stopped containers which docker-compose is reusing, can you remove the stopped containers before retrying. Also you may want to pull the most recent image from the docker hub. Here are my test results: # docker-compose up
Creating mysql_mysql_1
Attaching to mysql_mysql_1
mysql_1 | Installing database...
mysql_1 | Starting MySQL server...
mysql_1 | Waiting for database server to accept connections..
mysql_1 | Creating debian-sys-maint user...
mysql_1 | Creating database "db"...
mysql_1 | Granting access to database "db" for user "db"...
mysql_1 | 151221 16:35:36 mysqld_safe Logging to syslog.
mysql_1 | 151221 16:35:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^CGracefully stopping... (press Ctrl+C again to force)
Stopping mysql_mysql_1 ... done
ERROR:
Aborting.
# docker-compose up
Starting mysql_mysql_1
Attaching to mysql_mysql_1
mysql_1 | Creating database "db"...
mysql_1 | Granting access to database "db" for user "db"...
mysql_1 | 151221 16:35:45 mysqld_safe Logging to syslog.
mysql_1 | 151221 16:35:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql |
Looks we could close ticket. |
Hi, I know this is a very old issue. We had a similar problem, when restarting the mysql-redmine docker container. It boiled down to the modified mysql root user password (we just dont want to have none). Lines 71 to 88 in b33e19d
Possibly there should be a more robust way in checking for database status, but I am not really that experienced to provide a solution. |
I restart my mysql containers, according to the 'docker logs - tf mysql' command to check the log information to quote the following error:
Could not connect to mysql server. Aborting...
Could you tell me what could be the cause?
The text was updated successfully, but these errors were encountered: