ERROR 1064 (42000): You have an error in your SQL syntax; ... near 'databasesst test1' at line 1

  在Mysql建表时,使用create 语句,如:’mysql> create database test1;‘,Mysql报错: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 'database test1' at line 1

上网查是语法错误,当你输入语句没有加分号就enter,Mysql不会报错,但你在后面输入正确的命令,Mysql会把两条语句当成一条执行,如,‘ create database test1  create database test1;’,就会报错。在报错后再次输入正确的创建命令就可以了。

but,我发现并没有什么用,还是会报: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 'database test1' at line 1

解决:

mysql> create

        -> database

        -> test1

        -> ;

显示:

Query OK, 1 row affected (0.01 sec)

建表成功!

我觉得是我空格键的问题,还在研究中。。

你可能感兴趣的:(ERROR 1064 (42000): You have an error in your SQL syntax; ... near 'databasesst test1' at line 1)