尝试导入SQLFLE,但遇到此错误

3qpi33ja  于 2021-06-19  发布在  Mysql
关注(0)|答案(1)|浏览(602)

这是cmd提示符上的错误: C:\xampp\mysql\bin>mysql -p -u root --default_character_set utf8 recipes < recipes.sql 输入密码:****

ERROR 1064 (42000) at line 20: 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 '"admin" (
  "admin_id" int(10) NOT NULL,
  "f_name" text NOT NULL,
  "l_name" te' at line 1

这是我尝试在phpmyadmin“error static analysis:
分析中发现4处错误。

A symbol name was expected! (near ""admin_id"" at position 383)
At least one column definition was expected. (near ""admin_id"" at position 383)
Unexpected beginning of statement. (near "20" at position 398)
Unrecognized statement type. (near "NOT NULL" at position 402)
SQL query:

-- phpMyAdmin SQL Dump -- version 4.8.3. -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: August 29, 2018 at 09:56 AM -- Server version: 5.1.37 -- PHP Version: 7.2.9 -- -- Database: `recipes` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE IF NOT EXISTS "admin" ( "admin_id" int(20) NOT NULL, "f_name" text NOT NULL, "l_name" text NOT NULL, "email" varchar(250) NOT NULL, "c_email" varchar(250) NOT NULL, "pass" varchar(250) NOT NULL, "c_pass" varchar(250) NOT NULL, "u_name" varchar(150) NOT NULL, "address" text NOT NULL, "date_of_birth" varchar(50) NOT NULL, "city" text NOT NULL, "state" text NOT NULL, "country" text NOT NULL, "gender" text NOT NULL, "p_o" int(50) NOT NULL, PRIMARY KEY ("admin_id") ) AUTO_INCREMENT=1

mysql说:文档

1064-您的sql语法有错误;检查与您的mariadb服务器版本相对应的手册,了解使用“admin”附近的正确语法(

“admin\u id”int(20)not null,“f\u name”text not null,“l\u name”'在第20行这是我的代码`

kfgdxczn

kfgdxczn1#

删除“”
这应该是查询

CREATE TABLE IF NOT EXISTS admin 
( 
    admin_id int(20) NOT NULL, 
    f_name text NOT NULL, 
    l_name text NOT NULL, 
    email varchar(250) NOT NULL, 
    c_email varchar(250) NOT NULL, 
    pass varchar(250) NOT NULL, 
    c_pass varchar(250) NOT NULL, 
    u_name varchar(150) NOT NULL, 
    address text NOT NULL, 
    date_of_birth varchar(50) NOT NULL, 
    city text NOT NULL, 
    state text NOT NULL, 
    country text NOT NULL, 
    gender text NOT NULL, 
    p_o int(50) NOT NULL, 
    PRIMARY KEY (admin_id) 
) AUTO_INCREMENT=1

相关问题