Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 我的数据库有一些语法错误,但我可以';我找不到,所以我想我可以在这里问一下_Mysql_Database_Mariadb - Fatal编程技术网

Mysql 我的数据库有一些语法错误,但我可以';我找不到,所以我想我可以在这里问一下

Mysql 我的数据库有一些语法错误,但我可以';我找不到,所以我想我可以在这里问一下,mysql,database,mariadb,Mysql,Database,Mariadb,这就是我的db CREATE TABLE IF NOT EXISTS `users` ( `userId` int(8) NOT NULL AUTO_INCREMENT, `userName` varchar(55) NOT NULL, `password` varchar(55) NOT NULL, `firstName` varchar(55) NOT NULL, `lastName` varchar(55) NOT NULL, PRIMARY KEY (`

这就是我的db

CREATE TABLE IF NOT EXISTS `users` (
  `userId` int(8) NOT NULL AUTO_INCREMENT,
  `userName` varchar(55) NOT NULL, 
  `password` varchar(55) NOT NULL, 
  `firstName` varchar(55) NOT NULL, 
  `lastName` varchar(55) NOT NULL, 
   PRIMARY KEY (`userId`) ) 
INSERT INTO `users` (`userId`, `userName`, `password`, `firstName`, `lastName`) 
  VALUES (24, 'joel', '', 'Joel', 'Thomas'), (26, 'merlinsofia', '', 'merlin', 'sofia'), (27, 'matt', '', 'Matthew', 'Matthew'), (28, 'mike', '', 'Mike', 'Anto')
这些都是错误

分析中发现6处错误

Unexpected beginning of statement. (near "`userId`" at position 257)
Unexpected beginning of statement. (near "`userName`" at position 267)
Unexpected beginning of statement. (near "`password`" at position 279)
Unexpected beginning of statement. (near "`firstName`" at position 291)
Unexpected beginning of statement. (near "`lastName`" at position 304)
Unrecognized statement type. (near "VALUES" at position 316)
SQL查询:

CREATE TABLE IF NOT EXISTS `users` ( 
 `userId` int(8) NOT NULL AUTO_INCREMENT, 
 `userName` varchar(55) NOT NULL, 
 `password` varchar(55) NOT NULL, 
 `firstName` varchar(55) NOT NULL, 
`lastName` varchar(55) NOT NULL, PRIMARY KEY (`userId`) ) 
INSERT INTO `users` (`userId`, `userName`, `password`, `firstName`, `lastName`) 
   VALUES (24, 'joel', '', 'Joel', 'Thomas'), (26, 'merlinsofia', '', 'merlin', 'sofia'), (27, 'matt', '', 'Matthew', 'Matthew'), (28, 'mike', '', 'Mike', 'Anto')
MySQL说:文档

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO `users` (`userId`, `userName`, `password`, `firstName`, `lastName`) ' at line 1

我似乎找不到错误,但请记住,我是一个初学者,所以我想在这里寻求帮助

创建和插入需要用
分隔。就这些

试试这个:

CREATE TABLE IF NOT EXISTS `users` (
  `userId` int(8) NOT NULL AUTO_INCREMENT,
  `userName` varchar(55) NOT NULL, 
  `password` varchar(55) NOT NULL, 
  `firstName` varchar(55) NOT NULL, 
  `lastName` varchar(55) NOT NULL, 
   PRIMARY KEY (`userId`) ) ;
INSERT INTO `users` (`userId`, `userName`, `password`, `firstName`, `lastName`) 
  VALUES (24, 'joel', '', 'Joel', 'Thomas'), (26, 'merlinsofia', '', 'merlin', 'sofia'), (27, 'matt', '', 'Matthew', 'Matthew'), (28, 'mike', '', 'Mike', 'Anto')

这个问题与
MySQL
有关,我已经删除了
sqlserver
标记
create
语句的末尾。语法错误。