Django進行數據遷移時,報錯:(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6) NOT NULL)' at line 1")


 

進行數據遷移時:

第一步:

命令:python manage.py makemigrations

在對應的應用里面的migrations文件夾中產生了一個0001_initial.py文件

 

第二步:執行sqlmigrate命令查看生成的文件本質

命令:python manage.py sqlmigrate 應用名 文件名前綴

例如:python manage.py sqlmigrate myblog 0001

 

第三步:執行migrate命令真正生成數據庫表文件

命令:python manage.py migrate

 

 

 

現在出現一個問題:當執行第三步,同步數據庫的時候,報錯:

 

 經過網上搜索,原因是:

django2.1 版本不再支持mysql5.5

 

沒辦法,我的解決辦法是:更換了Django版本號,或者mysql版本號。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 解決:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1 【異常】MySQL建表報錯:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"order"' at line 1 SQL語句報錯:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '11. set password for 'root'@'localhost' php"> [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''

php You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"id", Mysql語法錯誤之> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near' MySql 執行語句錯誤 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM