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刪除。



猜您在找 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 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 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", mybatis批量更新update-設置多個字段值 報錯 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 解決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 (order_name, customer) 插入數據庫失敗([Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version) check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '123456' WITH GRANT OPTION' at line 1 mybatis的報錯總結_____2Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ri Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your My
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM