Django连接MySQL8.0报错
django.db.utils.OperationalError: (1045, "Access denied for user '16066'@'localhost' (using password: NO)")
原因一:
? ? ? ? 账户密码不对。查看MySQL账户密码修改正确即可
原因二:
? ? ? ? 在Django项目的settings,py文件中的配置有问题,把大写写成了小写,如下
'user':'root',
'password':'*******',#自己的密码
改为:
'USER':'root',
'PASSWORD':'*******',
?结果如下:
Performing system checks...
Watching for file changes with StatReloader
System check identified no issues (0 silenced).
You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
February 06, 2022 - 19:58:50
Django version 4.0.2, using settings 'djangoProject.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
|