错误内容:django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1064, "You have an error in your SQL syntax; check the m 查看了博客是版本不兼容,用cmd进行版本查看: MySQL为mysql -u用户名 -p密码 python为输入python或直接输入python --version Django为进入python后输入>>> import django 我的Django是2.1,python是3.7,MySQL是5.5 https://blog.csdn.net/qq_36963372/article/details/82558085 此文描述需要升级MySQL至少到5.6 进入mysql后使用 show variables like "%char%" 来查看mysql位置(或者输入select @@basedir as basePath from dual) 接着用此博客方法进行更新: https://www.cnblogs.com/xkfeng/p/7860124.html 安装mysql记得配置环境变量哦,如:
使用MySQL创建create database 相对应PyCharm项目APP数据库名字 回到PyCharm,打开terminal,输入python manage.py makemigrations: 输入python manage.py migrate: 成功! 代码创建: mysql查看创建结构: |
|