After closing the terminal, without leaving the "Connection Failure Error". Django 1.8

Without any reason, after closing the terminal window without exiting and stopping the server, the next time I run any command, for example python manage.py migrate / runserver / makemigrations, I get the following trace. I can’t understand what is wrong right now?

EDIT: Also in the mysql command, enter your interface 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

EDIT2: I suppose this could be caused by MAMP, which is also installed on my MAC

EDIT3: After I uninstalled MAMP. Not sure if this was directly related. Unable to enter mysql shell.

 django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") 

EDIT4 !!:
I use a terminal on mac, so I applied this command sudo /usr/local/mysql/support-files/mysql.server start and returned

 ERROR! MySQL server process #1180 is not running! Starting MySQL..... ......... ......... 

after trying to start the server

 ERROR! The server quit without updating PID file (/usr/local/mysql/data/MacBook-Air-Vitalij.local.pid). 

reboot command:

 ERROR! MySQL server PID file could not be found! 

EDIT5: after recommending the answer, I tried changing max_connections, but to no avail:

 mysql --help | grep "Default options" -A 1 Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 

I tried all the ways, but he was absent. And I can’t find this file manually, I am funding that my.cnf is not in MySQL for Mac. Also tried to uninstall MySQL and reinstall it - also did not help.

 open -a Finder etc/mysql/my.cnf The file /Users/TheKotik/djboy/etc/mysql/my.cnf does not exist. 

enter image description here enter image description here

+7
python django mysql terminal
source share
2 answers

consider max_connections increase and restart mysql.

 sudo /usr/local/mysql/support-files/mysql.server restart 

For some reason, the connection was not closed correctly when the terminal was closed. Increasing max_connections will not cure it completely, but a dangling connection will eventually be a timeout.

+2
source share

Have you tried restarting the mysql process ?. This can be useful if the mysql process is not completed correctly.

 mysql.server restart 
0
source share

All Articles