writehat
writehat copied to clipboard
connection issue to mysql
I keep getting django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 111] Connection refused)")
I have changed 'mysql' to '127.0.0.1' in the writehat.conf file to try and fix the issue but I get this error either way.
The connection failure happens in the socket.py file
Check docker ps -a
, is the writehat MySQL container running? If yes, are the credentials correct? Can you login to it manually using MySQL command line tool?
Okay so I ran the following
docker-compose up --build
this met with the same error
docker-compose up -d
no error
docker ps -a
the MySQL database was running
I check through all of the passwords and they all matched
docker-compose exec mysql bash
got in with no problem
mysql -u writehat -p
I used the password I had set and I was denied access
Also I tried docker-compose exec writehat bash
and this just keeps restarting
Just noticed these warnings while running docker-compose down
WARNING: The t2897 variable is not set. Defaulting to a blank string. WARNING: The t6216 variable is not set. Defaulting to a blank string
I'm having difficulty reproducing this, however it is pretty normal to see mysql-related errors when bringing up docker-compose, since the mysql container takes a long time to start.
Can you make sure you're operating from a fresh clone of writehat, and then run docker-compose down
before you run docker-compose up
? You can paste the output of docker-compose up
here.
Seeing how OP hasn't responded anymore, please go ahead and close this issue report.