MYSQL #1064错误
以下是错误提示:
Script line: 1 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 'default tinyint(1) NOT NULL default '0',
custom_banner_code text,
last_sho' at line 13
Script line: 33 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 'option varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0'' at line 9
Script line: 51 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 'mediumtext NOT NULL,
state tinyint(3) NOT NULL default '0',
sectionid int(' at line 6
Script line: 91 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 'default tinyint(1) NOT NULL default '0',
custom_banner_code text,
last_sho' at line 13
Script line: 129 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 'option varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0'' at line 9
Script line: 148 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 'mediumtext NOT NULL,
state tinyint(3) NOT NULL default '0',
sectionid int(' at line 6
麻烦大家了。。我刚学MYSQL。。还不懂
CREATE TABLE components (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
link varchar(255) NOT NULL default '',
menuid int(11) unsigned NOT NULL default '0',
parent int(11) unsigned NOT NULL default '0',
admin_menu_link varchar(255) NOT NULL default '',
admin_menu_alt varchar(255) NOT NULL default '',
option varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0',
admin_menu_img varchar(255) NOT NULL default '',
iscore tinyint(4) NOT NULL default '0',
params text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
复制不了这么多,,加我的QQ:100840912 展开
出现这种情况是因为你建表的SQL语句有错误,
你的给出的代码里option为MYSQL关键字,不能直接写,需要用`包括起来,为: `option` varchar(50) NOT NULL default ''
----下面就没问题了
CREATE TABLE components (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
link varchar(255) NOT NULL default '',
menuid int(11) unsigned NOT NULL default '0',
parent int(11) unsigned NOT NULL default '0',
admin_menu_link varchar(255) NOT NULL default '',
admin_menu_alt varchar(255) NOT NULL default '',
`option` varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0',
admin_menu_img varchar(255) NOT NULL default '',
iscore tinyint(4) NOT NULL default '0',
params text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
扩展资料:
MYSQL 报错解决:
1.Starting MySQL.Manager of pid-file quit without updating fi[失败]
关于这个错误原因有很多,最大的可能是没有创建测试数据库,可以用/usr/local/mysql/scripts/mysql_install_db –user=mysql命令进行创建;另外一个原因可能是权限设置问题,需要赋予mysql的data权限,可以用chmod -R 命令。
2.FATAL ERROR: Could not find /home/mysql/bin/my_print_defaults If you are using a binary release,you must run this script from
within the directory the archive extracted into. If you compiled
MySQL yourself you must run ‘make install’ first.
这个错误,是没有指明mysql的data路径导致的:
vim /etc/my.cnf
在[mysqld] 后面加上路径:
basedir = /usr/local/mysql
datadir =/opt/data;
3.-bash: mysql: command not found
用mysql命令进行登陆mysql报错,原因是没有设置环境变量,需要设置。
mysql -u root
4.ERROR 1130: Host ’192.168.1.3′ is not allowed to connect to this MySQL server
用mysql远程工具链接数据库报错,这个错误原因是没有开放远程链接功能,可以在mysql里面输入如下命令进行解决:GRANT ALL PRIVILEGES ON *.* TO ’root‘@’%' IDENTIFIED BY ’password’ WITH GRANT OPTION
参考资料:百度百科-mySQL
2024-11-19 广告
==================================
你的给出的代码里option为MYSQL关键字,不能直接写,需要用`包括起来(它为数字键1左边的键上的字符),为: `option` varchar(50) NOT NULL default ''
----下面就没问题了
CREATE TABLE components (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
link varchar(255) NOT NULL default '',
menuid int(11) unsigned NOT NULL default '0',
parent int(11) unsigned NOT NULL default '0',
admin_menu_link varchar(255) NOT NULL default '',
admin_menu_alt varchar(255) NOT NULL default '',
`option` varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0',
admin_menu_img varchar(255) NOT NULL default '',
iscore tinyint(4) NOT NULL default '0',
params text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;