无法识别的语句类型。 (在位置 4 "User" 附近)

Unrecognized statement type. (near "User" at position 4)

Static analysis:

1 errors were found during analysis.

Unrecognized statement type. (near "User" at position 4) SQL query:

----User Table Create---- CREATE TABLE User_( u_ID char(5) NOT NULL, u_NIC char(12) NOT NULL, u_f_name varchar(50), u_l_name varchar(50), u_email varchar(50), u_address varchar(255), u_dob date, u_role varchar(20), constraint user_PK primary key(u_ID), constraint Uu_IDChk check(u_ID like '[u/U][0-9][0-9][0-9][0-9]'), )

MySQL said: Documentation

#1064 - 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 '----User Table Create---- CREATE TABLE User_( u_ID char(5) NOT NULL, u_NIC ' at line 1

将数据库导入 phpmyadmin 时出现此错误。如何解决这个问题?

代码:

----User Table Create----
CREATE TABLE User_(
    u_ID char(5) NOT NULL,
    u_NIC char(12) NOT NULL,
    u_f_name varchar(50),
    u_l_name varchar(50),
    u_email varchar(50),
    u_address varchar(255),
    u_dob date,
    u_role varchar(20),

    constraint user_PK primary key(u_ID),
    constraint Uu_IDChk check(u_ID like '[u/U][0-9][0-9][0-9][0-9]'),
);

MariaDB comment syntax 需要在初始 -- 字符后添加 space。如果省略 space.

是语法错误

错误:

----User Table Create----

右:

-- User Table Create --