本文介绍了由于出现错误,SQL查询无法在phpMyAdmin上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已在phpMyAdmin上输入此代码作为SQL查询.我正在尝试创建一个表(这是另一个站点的副本和粘贴的代码)
I have entered this code on phpMyAdmin as an SQL query. I am trying to create a table (this is a copy and pasted code from another site)
CREATE TABLE `members` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(65) NOT NULL default '',
`password` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
--
-- Dumping data for table `members`
--
INSERT INTO `members` VALUES (1, 'john', '1234');
我收到错误
#1064-您的SQL语法有误;请查看与您的MySQL服务器版本相对应的手册以获取正确的语法,以在第6行的'TYPE = MyISAM AUTO_INCREMENT = 2'附近使用
"#1064 - 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 'TYPE=MyISAM AUTO_INCREMENT=2' at line 6 "
推荐答案
指定存储引擎应该不是ENGINE:
It should be ENGINE not TYPE to specify the storage engine:
CREATE TABLE `members` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(65) NOT NULL default '',
`password` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 ;
请参见创建表语法:
自MySQL 4.0起,该选项TYPE已在MySQL 5.5中删除:
The option TYPE was removed with MySQL 5.5, deprecated since MySQL 4.0:
这篇关于由于出现错误,SQL查询无法在phpMyAdmin上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!