Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/75.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_Sql - Fatal编程技术网

为什么这个mysql代码有错误?

为什么这个mysql代码有错误?,mysql,sql,Mysql,Sql,我在使用这个mysql代码时看到错误,为什么 CREATE TABLE books ( id int(6) unsigned NOT NULL auto_increment, title varchar(100) NOT NULL default '', author varchar(100) NOT NULL default '', price decimal(3,2) NOT NULL default '0.00', PRIMARY

我在使用这个mysql代码时看到错误,为什么

CREATE TABLE books (
      id int(6) unsigned NOT NULL auto_increment,
      title varchar(100) NOT NULL default '',
      author varchar(100) NOT NULL default '',
      price decimal(3,2) NOT NULL default '0.00',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;

    INSERT INTO books VALUES (1, 'Where God Went Wrong', 'Oolon Colluphid', '24.99');
    INSERT INTO books VALUES (2, 'Some More of God\'s Greatest Mistakes', 'Oolon Colluphid', '17.99');
    INSERT INTO books VALUES (3, 'Who Is This God Person Anyway?', 'Oolon Colluphid', '14.99');
1064-您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 第7行“类型=MyISAM”附近


使用
引擎
而不是
类型
类型早已废弃。

替换

TYPE=MyISAM;

它不再是
类型
。改用名称
引擎

TYPE keyword is depreciated (since 5.0) and not supported in MySQL5.5

您应该使用
引擎
而不是
类型

这个错误告诉你到底出了什么问题。
TYPE keyword is depreciated (since 5.0) and not supported in MySQL5.5