#1064 - MySQL Error - mysql

CREATE TABLE `phpbb_acl_groups` (
`group_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0',
`forum_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0',
`auth_option_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0',
`auth_role_id` MEDIUMINT( 8 ) UNSIGNED NOT NULL DEFAULT '0',
`auth_setting` TINYINT( 2 ) NOT NULL DEFAULT '0',
KEY `group_id` ( `group_id` ) ,
KEY `auth_opt_id` ( `auth_option_id` ) ,
KEY `auth_role_id` ( `auth_role_id` )
) TYPE = MYISAM ;
MySQL meldet: Documentation
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' at line 10

TYPE = MYISAM ; has been depreciated and you should be using engine instead
engine = MYISAM

Related

mysql syntax error: 'USING BTREE ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 AUTOINCREMENT='

Im getting this error:
CREATE TABLE `pdc5l_usergroups` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Clave primaria',
`parent_id` int( 10 ) unsigned NOT NULL DEFAULT '0' COMMENT 'ID Lista de referencia adyacente',
`lft` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Anidadas conjunto lft.',
`rgt` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Anidadas conjunto rgt.',
`title` varchar( 100 ) NOT NULL DEFAULT '',
PRIMARY KEY ( `id` ) ,
UNIQUE KEY `idx_usergroup_parent_title_lookup` ( `parent_id` , `title` ) ,
KEY `idx_usergroup_title_lookup` ( `title` ) ,
KEY `idx_usergroup_adjacency_lookup` ( `parent_id` ) ,
KEY `idx_usergroup_nested_set_lookup` ( `lft` , `rgt` ) USING BTREE
) ENGINE = MYISAM AUTO_INCREMENT =9 DEFAULT CHARSET = utf8AUTOINCREMENT =9;
MySQL said: Documentation
#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 'USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 AUTOINCREMENT=' at line 11
I have tried these:
) ENGINE = MYISAM AUTO_INCREMENT =9 DEFAULT CHARSET = utf8 AUTO_INCREMENT =9;
) ENGINE = MYISAM AUTOINCREMENT =9 DEFAULT CHARSET = utf8 AUTOINCREMENT =9;
) ENGINE = MYISAM AUTOINCREMENT =9 DEFAULT CHARSET = utf8 AUTO_INCREMENT =9;
but I still get the error.
phpmyadmin says this: MySQL client version: 4.1.22
This is a mysql version problem. You can see the issue in that bug:
http://bugs.mysql.com/bug.php?id=25162
Before MySQL 5.0.60, this option can be given only before the ON
tbl_name clause. Use of the option in this position is deprecated as
of 5.0.60 and support for it there will be removed in a future MySQL
release. If an index_type option is given in both the earlier and
later positions, the final option applies.
TYPE type_name is recognized as a synonym for USING type_name.
However, USING is the preferred form.
For more details see here: http://www.dbforums.com/mysql/1617755-using-btree.html

Error in SQL Syntax. What would be the proper solution or right syntax to use for a successful result?

MySQL said:
#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 '(14) NOT NULL ) ENGINE=MyISAM' at line 23
CREATE TABLE `activity_points` (
`fk_user_id` INT( 10 ) NOT NULL DEFAULT '0',
`date` DATE NOT NULL DEFAULT '0000-00-00',
`points` INT( 10 ) NOT NULL DEFAULT '0',
`lastupdate` TIMESTAMP( 14 ) NOT NULL
) ENGINE = MYISAM ;
TIMESTAMP shouldn't have length
CREATE TABLE `activity_points` (
`fk_user_id` INT( 10 ) NOT NULL DEFAULT '0',
`date` DATE NOT NULL DEFAULT '0000-00-00',
`points` INT( 10 ) NOT NULL DEFAULT '0',
`lastupdate` TIMESTAMP NOT NULL
) ENGINE = MYISAM ;

Why won't MySQL statement work?

I am using PHPMyAdmin right now and I am creating a new table with these values below but it's not working and I can't see why at all.
SQL query:
CREATE TABLE `database`.`hub_attendance_lessons` (
`id` BIGINT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`lesson_id` BIGINT( 10 ) UNSIGNED NOT NULL ,
`course_id` BIGINT( 10 ) UNSIGNED NOT NULL ,
`student_id` BIGINT( 10 ) UNSIGNED NOT NULL ,
`date` BIGINT( 10 ) UNSIGNED NOT NULL ,
`attended` BOOL( 2 ) UNSIGNED NULL ,
`absent` BOOL( 2 ) UNSIGNED NULL ,
`excused_absent` BOOL( 2 ) UNSIGNED NULL ,
`late` BOOL( 2 ) UNSIGNED NULL ,
`excused_late` BOOL( 2 ) UNSIGNED NULL
)
ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci
COMMENT = 'stores the attendance of all lessons for all students';
MySQL said:
#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 '(2) UNSIGNED NULL, absent
BOOL(2) UNSIGNED NULL, `excused_absent` BOOL(2) UNSI' at line 1
BOOL and BOOLEAN are just shorthand for TINYINT(1). It makes no sense to have a BOOL(2). Remove all lengths of 2 for your booleans.

MYSQL Error #1064 Error in SQL Syntax

I keep getting this error:
MySQL said: Documentation
#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 'USING BTREE
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13' at line 11
with this with this query:
SQL query:
CREATE TABLE IF NOT EXISTS `jml_usergroups` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key',
`parent_id` int( 10 ) unsigned NOT NULL DEFAULT '0' COMMENT 'Adjacency List Reference Id',
`lft` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Nested set lft.',
`rgt` int( 11 ) NOT NULL DEFAULT '0' COMMENT 'Nested set rgt.',
`title` varchar( 100 ) NOT NULL DEFAULT '',
PRIMARY KEY ( `id` ) ,
UNIQUE KEY `idx_usergroup_parent_title_lookup` ( `parent_id` , `title` ) ,
KEY `idx_usergroup_title_lookup` ( `title` ) ,
KEY `idx_usergroup_adjacency_lookup` ( `parent_id` ) ,
KEY `idx_usergroup_nested_set_lookup` ( `lft` , `rgt` ) USING BTREE
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =13;
Any idea what the problem is? these errors are like the thorns on a rose
The syntax is ok, your problem is probably that you're trying to run it on a MySQL version earlier than 5.1, which does not have USING BTREE.

Error #1064 in mysql [duplicate]

This question already has answers here:
1064 error in CREATE TABLE ... TYPE=MYISAM
(5 answers)
Closed 9 years ago.
I keep getting this error:
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=58' at line 11
This is my query :
CREATE TABLE `tbl_cart` (
`ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`pd_id` int( 10 ) unsigned NOT NULL default '0',
`ct_qty` mediumint( 8 ) unsigned NOT NULL default '1',
`ct_session_id` char( 32 ) NOT NULL default '',
`ct_date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( `ct_id` ) ,
KEY `pd_id` ( `pd_id` ) ,
KEY `ct_session_id` ( `ct_session_id` )
) TYPE = MYISAM AUTO_INCREMENT =58;
Help Me What the problem is ...
The keyword TYPE is removed since MySQL 5.1, use
) ENGINE = MYISAM AUTO_INCREMENT =58;
instead.
CREATE TABLE `tbl_cart` (
`ct_id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
`pd_id` int( 10 ) unsigned NOT NULL default '0',
`ct_qty` mediumint( 8 ) unsigned NOT NULL default '1',
`ct_session_id` char( 32 ) NOT NULL default '',
`ct_date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( `ct_id` ) ,
KEY `pd_id` ( `pd_id` ) ,
KEY `ct_session_id` ( `ct_session_id` )
) ENGINE = MYISAM AUTO_INCREMENT =58;