【发布时间】:2021-06-05 09:21:40
【问题描述】:
Big Sur 更新后的一些问题
我使用 Django 2.1.15 和 Python 3.8
根据帖子和文档,我安装了连接器
brew install mysql-connector-c
和
pip install mysql-python
安装mysql后
brew install mysql
和客户
pip install mysqlclient
尝试运行 django,我得到这个错误:
django.db.utils.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 54")
这是我的设置.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'BATABASE',
'USER': 'sa',
'PASSWORD': 'password',
'HOST': '192.168.1.10',
'PORT': '1433',
}
}
【问题讨论】: