【发布时间】:2017-03-23 06:55:12
【问题描述】:
在我没有退出和停止服务器的情况下关闭终端窗口后,没有任何理由,下次我运行任何命令时,如 python manage.py migrate/runserver/makemigrations 我得到以下回溯。我真的不明白什么是现在错了吗?
编辑:同样在“mysql”命令上进入其界面'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
EDIT2:我想这可能是由我的 MAC 上也安装的 MAMP 引起的
EDIT3:在我删除 MAMP 之后。不确定是否是直接连接的。也无法进入mysql shell。
django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")
EDIT4!!:
我在mac上使用终端,所以我应用了这个命令
须藤/usr/local/mysql/support-files/mysql.server start
回来了
ERROR! MySQL server process #1180 is not running! Starting MySQL..... ......... .........
尝试启动服务器后
ERROR! The server quit without updating PID file (/usr/local/mysql/data/MacBook-Air-Vitalij.local.pid).
重启命令:
ERROR! MySQL server PID file could not be found!
EDIT5:按照答案的建议,我尝试更改 max_connections,但没有成功:
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
我尝试了所有路径,但都不存在。而且我无法手动找到这个文件,我发现 MySQL for Mac 中没有 my.cnf 。还尝试删除 MySQL 并重新安装它 - 也没有帮助。
open -a Finder etc/mysql/my.cnf
The file /Users/TheKotik/djboy/etc/mysql/my.cnf does not exist.
【问题讨论】:
-
这可能会有所帮助:stackoverflow.com/q/16161889/2286762
-
@soupboy 查看编辑
-
您是否搜索了您在编辑中指定的错误? stackoverflow.com/q/16325607/2286762
-
@soupboy 是的,这个错误可能是由很多不同的原因引起的,考虑到在关闭一切正常之前,它可能是一种错误
-
好的。您使用的是哪个 django 和 mysql 版本?
标签: python mysql django terminal