I'm attempting to import an SQL file generated by 5.5.25-MariaDB-mariadb1 into 5.1.55-rel12.6 - (Percona Server (GPL), 12.6 , Revision 200) after importing the first 11 tables the import process breaks with the following error:-
ERROR 1064 (42000) at line 35252: 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 'PAGE_CHECKSUM=1' at line 10
Line 35252 contains the following:-
CREATE TABLE `kygvj_bwps_lockouts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` int(1) NOT NULL,
`active` int(1) NOT NULL,
`starttime` int(10) NOT NULL,
`exptime` int(10) NOT NULL,
`host` varchar(20) DEFAULT NULL,
`user` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=Aria AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1;
Can anyone suggest what the right syntax might be? I have been unable to locate the documentation referred to in the error message.
Related
Currently trying to put a local website online.
Specification:
* PHP 7.1
* My SQL 5.5
When trying to import my DB I receive the following error message:
Requête SQL:
Base de données : vs
Structure de la table vsc_aps_social_icons
CREATE TABLE IF NOT EXISTS `vsc_aps_social_icons` (
`si_id` int(11) NOT NULL AUTO_INCREMENT,
`icon_set_name` varchar(255) DEFAULT NULL,
`icon_display` varchar(255) DEFAULT NULL,
`num_rows` varchar(255) DEFAULT NULL,
`icon_margin` varchar(255) DEFAULT NULL,
`icon_tooltip` int(11) NOT NULL,
`tooltip_background` varchar(255) DEFAULT NULL,
`tooltip_text_color` varchar(255) DEFAULT NULL,
`icon_animation` varchar(255) DEFAULT NULL,
`opacity_hover` varchar(20) DEFAULT NULL,
`icon_details` text,
`icon_extra` text,
PRIMARY KEY (`si_id`)
) TYPE=InnoDB AUTO_INCREMENT=3 ;
MySQL a répondu: 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=InnoDB AUTO_INCREMENT=3' at line 25
It's the 1st time I put a website online so may your explanations be as complete as possible.
Thanks,
E
Use ENGINE = InnoDB instead of TYPE = InnoDB. TYPE was removed in 5.1.
I am trying to import a .sql file that was created with mysql 4.0 into the latest version of mysql and have received a syntax error regarding the following code:
CREATE TABLE edgemap (
senderid int(10) unsigned default NULL,
recipientid int(10) unsigned default NULL,
messageid int(10) unsigned default NULL,
messagedt timestamp(14) NOT NULL,
reciptype enum('bcc','cc','to') default NULL,
subject varchar(255) default NULL,
KEY senderid (senderid,recipientid),
KEY messageid (messageid),
KEY messagedt (messagedt),
KEY senderid_2 (senderid),
KEY recipientid (recipientid)
) ENGINE=MyISAM;
The error message I receive is:
ERROR 1064 (42000) at line 255752: 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,
reciptype enum('bcc','cc','to') default NULL,
subject varchar' at line 5
Any help would be much appreciated!
timestamp has maximum precision of 6 (microseconds):
http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html
So change it to
messagedt timestamp NOT NULL,
or
messagedt timestamp(6) NOT NULL,
http://sqlfiddle.com/#!9/221c13
enum may not default to allowing NULL values in mysql 5, try changing that line to:
reciptype enum('bcc','cc','to') NULL,
I have the following SQL to create a table on a MySQL 5.6.13 instance:
CREATE TABLE 'exchange' (
'id' int NOT NULL AUTO_INCREMENT,
'abbrev' varchar(32) NOT NULL,
'name' varchar(255) NOT NULL,
'city' varchar(255) NULL,
'country' varchar(255) NULL,
'currency' varchar(128) NULL,
'time_zone_offset' time NULL,
'created_date' datetime NOT NULL,
'last_updated_date' datetime NOT NULL,
PRIMARY KEY ('id')
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
However, I keep getting the following unhelpful error:
ERROR 1064 (42000): 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
''exchange' ( 'id' int NOT NULL AUTO_INCREMENT,
'abbrev' varchar(32) NOT NULL, 'n' at line 1
I must be missing something glaringly obvious...
Any ideas where I'm going wrong?
Try :
CREATE TABLE exchange (
Ref:
http://dev.mysql.com/doc/refman/5.1/en/create-table.html
Remove all quotes, this helped me on a windows machine command line
I'm trying to create this table in SQL,
CREATE TABLE `online_status` (
`fk_user_id` int(10) unsigned NOT NULL default '0',
`last_activity` timestamp(14) NOT NULL,
PRIMARY KEY (`fk_user_id`)
) ENGINE=MyISAM;
but is returning 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 '(14) NOT NULL,
PRIMARY KEY (fk_user_id)
) ENGINE=MyISAM' at line 3
I've changed the commas, but the error continues. Can you help me on what is wrong?
`last_activity` timestamp(14) NOT NULL,
should be
`last_activity` timestamp NOT NULL,
Using the following query, I can't figure out why my update is not working. I'm sure its something stupid, but any help is greatly appreciated:
UPDATE Mail
SET From="Spouse"
WHERE ItemNum=9;
The Error is:
ERROR 1064 (42000): 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 'From="Spouse" WHERE ItemNum=9' at line 1
The schema of Mail is:
CREATE TABLE `Mail` (
`ItemNum` int(11) NOT NULL auto_increment,
`Qtr` int(11) NOT NULL default '0',
`MsgDate` date default NULL,
`From` varchar(64) default NULL,
`Message` varchar(255) default NULL,
PRIMARY KEY (`ItemNum`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1
From is a MySQL reserved keyword. Surround it with backticks:
UPDATE Mail
SET `From`="Spouse"
WHERE ItemNum=9;