ERROR 1064 (42000): You have an error in your SQL syntax;

Avatar
  • Answered
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 'dbtest' at line 1
------------------------------------------------------------------------------------------------------------------------------------------------------------


mysql>
CREATE DATABASE `dbtest` ;
CREATE TABLE `dbtest`.`users` (
`user_id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`user_name` VARCHAR( 25 ) NOT NULL ,
`user_email` VARCHAR( 35 ) NOT NULL ,
`user_pass` VARCHAR( 50 ) NOT NULL ,
UNIQUE (`user_email`)
) ENGINE = MYISAM ;


mysql> show tables;
+------------------+
| Tables_in_dbtest |
+------------------+
| users |
+------------------+
1 row in set (0.01 sec)

mysql> quit


any idea how to fix this ?
Avatar
Scott
Hello, Sorry to hear you are getting a 1064 error within your MySQL query. I ran the exact query you provided on my own server and it succeeded, just like yours did here. What are you doing when you get the error code you described above? Your code in the lower section does not show an error. You may want to take a look at our article on MySQL 1064 Errors as it goes over different scenarios that can cause it. Kindest Regards, Scott M