MySQL database error # 1064

I tried to create a user table in MySQL. I got error 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!

+3
source share
1 answer

Get rid of the comma after defining the last column:

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)
);
+2
source

All Articles