简体   繁体   English

您的 SQL 语法有错误; 检查与您的 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 ')

from bs4 import BeautifulSoup
import requests
import mysql.connector

my_db = mysql.connector.connect(
    host = "localhost",
    user = "root",
    password = "mypassword",
    database =  "findingimdbscore",
)
my_cursor = my_db.cursor()

my_cursor.execute("CREATE TABLE IF NOT EXISTS film_ve_puan (film_name VARCHAR(100),ImbdScore DOUBLE(4),film_id INTEGER AUTO_INCREMENT PRIMARY KEY)")

All of variables' color changed but film_id did'nt change btw所有变量的颜色都改变了,但 film_id 没有改变顺便说一句

DOUBLE(4) isn't a legal MySQL type. DOUBLE(4)不是合法的 MySQL 类型。 You could use FLOAT(4) or just DOUBLE .您可以使用FLOAT(4)或只是DOUBLE

CREATE TABLE film_ve_puan (
  film_name VARCHAR(100),
  ImbdScore DOUBLE,
  film_id INTEGER AUTO_INCREMENT PRIMARY KEY
)

See https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.htmlhttps://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html

我认为您应该将 DOUBLE(4) 更改为仅 DOUBLE

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “你的SQL语法有错误; 查看与您的MySQL服务器版本对应的手册,以便在''第1行'附近使用正确的语法 - “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 '' at line 1” 您的 SQL 语法有错误; 检查与您的 MySQL 服务器版本相对应的手册,以获取在 \'keyword")\' 附近使用的正确语法 - 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 \'keyword")\' 您的 SQL 语法有错误; 检查与您的 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 '*) 警告:您的SQL语法有错误; 查看与您的MySQL服务器版本对应的手册,以便在附近使用正确的语法 - Warning: 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 您的SQL语法有错误; 检查与您的MariaDB服务器版本对应的手册,以便在第1行附近使用正确的语法, - 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 at line 1", 1064(42000):您的 SQL 语法有错误; 检查与您的 MySQL 服务器版本相对应的手册,以获取正确的语法使用 - 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 修复“查看与您的 MySQL 服务器版本相对应的手册,以获取在 '%s 附近使用的正确语法” - FIX “Check the manual that corresponds to your MySQL server version for the right syntax to use near '%s” _mysql_exceptions错误(1064,“检查与MySQL服务器版本对应的手册,以便在'default'附近使用正确的语法)VALUES - _mysql_exceptions error(1064, "check the manual that corresponds to your MySQL server version for the right syntax to use near 'default) VALUES 您的 SQL 语法有错误; 检查与您的 MySQL 服务器 PYTHON 相对应的手册 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server PYTHON 42000您的SQL语法错误; 检查与您的MySQL服务器相对应的手册 - 42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM