相关截图(日志、错误):(myenv1) ubuntu@VM-16-15-ubuntu:~/myenv1/silverArrowOffWb$ python3 manage.py runserver 0.0.0.0:8000 Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). Exception in thread django-main-thread: Traceback (most recent call last): File "/home/ubuntu/myenv1/lib/python3.10/site-packages/django/db/backends/base/base.py", line 275, in ensure_connection self.connect() File "/home/ubuntu/myenv1/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/home/ubuntu/myenv1/lib/python3.10/site-packages/django/db/backends/base/base.py", line 256, in connect self.connection = self.get_new_connection(conn_params) File "/home/ubuntu/myenv1/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, **kwargs) File "/home/ubuntu/myenv1/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 255, in get_new_connection connection = Database.connect(**conn_params) File "/home/ubuntu/myenv1/lib/python3.10/site-packages/MySQLdb/__init__.py", line 121, in Connect return Connection(*args, **kwargs) File "/home/ubuntu/myenv1/lib/python3.10/site-packages/MySQLdb/connections.py", line 193, in __init__ super().__init__(*args, **kwargs2) MySQLdb.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
|
|