错误1:
ERROR! The server quit without updating PID file (/usr/local/var/mysql/jingjundeMacBook-Air.local.pid).
因为本地数据库没有啥重要的内容,选择直接移除
1.移除mysql
jingjun@jingjundeMacBook-Air ~ % brew uninstall mysql
Uninstalling /usr/local/Cellar/mysql/8.0.22... (294 files, 296.5MB)
jingjun@jingjundeMacBook-Air ~ % sudo rm -rf /usr/local/Cellar/mysql
2.重新安装
brew install mysql
3.重启服务
mysql.server start
错误2:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.1.
import pymysql
pymysql.version_info = (1, 4, 13, "final", 0)
pymysql.install_as_MySQLdb()
错误3:
安装好了Django,可是运行的时候发现一直提示错误
Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?"
# 进入虚拟环境下
source venv/bin/activate
错误4:
安装了MySQL,密码默认为空,运行Django时提示数据库密码错误
解决:检查数据库名称是否写对