Home >Database >Mysql Tutorial >Fix MySQL database error #1064?
Database error #1064 may occur due to incorrect syntax. For example, suppose we are creating the following table -
mysql> create table DemoTable ( UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserName varchar(100), UserAge int, UserAddress varchar(200), UserCountryName varchar(100) , isMarried boolean, );
This will produce the following output i.e. error -
ERROR 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 near ')' at line 10
To remove the above error you need to remove the last comma (,). Query as below to eliminate the error -
mysql> create table DemoTable ( UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserName varchar(100), UserAge int, UserAddress varchar(200), UserCountryName varchar(100), isMarried boolean ); Query OK, 0 rows affected (1.04 sec)
The above is the detailed content of Fix MySQL database error #1064?. For more information, please follow other related articles on the PHP Chinese website!