简体   繁体   中英

MySQL Database Error #1064

I was trying to create a users table in MySQL. I got the error message 1064. Here is the command I entered.

CREATE TABLE Users(
Usrid INT unsigned auto_increment PRIMARY KEY not null,
Username varchar(20),
Name varchar(25),
Surname varchar(25),
Email varchar(50),
Password varchar(50),
);

Any help would be greatly appreciated!

Get rid of the comma after your last column definition:

CREATE TABLE Users(
  Usrid INT unsigned auto_increment PRIMARY KEY not null,
  Username varchar(20),
  Name varchar(25),
  Surname varchar(25),
  Email varchar(50),
  Password varchar(50), <-- HERE
);

It should be

CREATE TABLE Users(
  Usrid INT unsigned auto_increment PRIMARY KEY not null,
  Username varchar(20),
  Name varchar(25),
  Surname varchar(25),
  Email varchar(50),
  Password varchar(50)
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM