1Django数据库迁移期间出现错误
2.描述如下
/root/workplace/python/virtualenv/env/lib/python3.8/site-packages/django/core/management/commands/makemigrations.py:160: RuntimeWarning: Got an error checking a consistent migration history performed for database connection 'default': (1049, "Unknown database 'shop-test'")
3.尝试解决
1是否是mysql密码错误,
1.1查看一下安装的MySQL是否有密码
sudo mysqladmin version
如果正常响应,说明没有密码(初始登录密码为空),如果报错,说明有密码。我这里是正常响应如下:
(env) root@Moon:~/workplace/python/virtualenv/env/myshop-test# mysqladmin version
mysqladmin Ver 8.0.36-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 8.0.36-0ubuntu0.20.04.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket