原文: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文件夾中產生了一個 initial.py文件 第二步:執行sqlmigrate命令查看生成的文件本質 命令:python manage.py sqlmigrate 應用名 文件名前綴 例如:python manage.py sqlmigrate myblog 第 ...

2019-06-11 11:18 0 1932 推薦指數:

查看詳情

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

報錯如圖: 最開始其實我的列名tname和tsubject分別叫name和subject,后來看到網上有說這個報錯可能是數據庫建表的時候使用了mysql的關鍵詞,我就只把name改了。后來還是這個問題,百思不得其解。 后來同學告訴我說老師幫她檢查SQL語句的問題時都是把php程序里的SQL ...

Sun Jun 16 08:20:00 CST 2019 0 11455
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM