Exporting/Importing mysql database
06-07-2005, 11:01 AM
|
Exporting/Importing mysql database
|
Posts: 177
Location: GA
|
I get this error message:
Quote:
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 'match (
match_id int(11) NOT NULL auto_increment,
match_name varchar(255) ' at line 1
|
I am importing the data into a Mysql database (MySQL 4.1.10-standard) from another MySQL database (MySQL 4.1.8-nt)
The SQL code is:
Quote:
# phpMyAdmin MySQL-Dump
# version 2.4.0
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Jun 07, 2005 at 04:00 PM
# Server version: 4.1.8
# PHP Version: 5.0.4
# Database : `pcgf_matches`
# --------------------------------------------------------
#
# Table structure for table `match`
#
CREATE TABLE match (
match_id int(11) NOT NULL auto_increment,
match_name varchar(255) NOT NULL default '',
match_date varchar(255) NOT NULL default '',
match_time varchar(255) NOT NULL default '',
match_m1 int(11) default NULL,
match_m2 int(11) default NULL,
match_m3 int(11) default NULL,
match_m4 int(11) default NULL,
match_m5 int(11) default NULL,
match_m6 int(11) default NULL,
match_ip varchar(255) NOT NULL default '',
match_pass varchar(255) NOT NULL default '',
match_done int(11) NOT NULL default '1',
PRIMARY KEY (match_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table `match`
#
INSERT INTO match VALUES (1, '[Dragoon]', '30/5/05', '7PM', 1, 2, 3, 4, 5, 0, '85.133.16.53:27115', 'pcgfmatch', 2);
INSERT INTO match VALUES (2, 'ES', '03/06/05', '7:30pm', 1, 7, 3, 6, 8, 0, '85.133.16.53:27115', 'pcgfmatch', 2);
INSERT INTO match VALUES (3, '[BuM]', '5th June 2005', '', 1, 15, 12, 11, 13, 0, '85.133.16.61:27175', 'arse', 2);
# --------------------------------------------------------
#
# Table structure for table `members`
#
CREATE TABLE members (
member_id int(11) NOT NULL auto_increment,
member_name varchar(255) NOT NULL default '',
member_email varchar(255) NOT NULL default '',
member_status int(11) NOT NULL default '1',
PRIMARY KEY (member_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table `members`
#
INSERT INTO members VALUES (1, 'HitRaj 47', 'mrkill47@gmail.com', 2);
INSERT INTO members VALUES (12, 'invulnerable_pig', 'invulnerablepig@gmail.com', 1);
INSERT INTO members VALUES (15, 'Apeman', 'themonkeydude@gmail.com.', 2);
INSERT INTO members VALUES (11, 'Spartan', 'phawkins1988@gmail.com', 1);
INSERT INTO members VALUES (10, 'Drizzt Do\'Urden', 'tom.drizztdourden@gmail.com', 1);
INSERT INTO members VALUES (14, 'TRAFMAN', 'james@ferretti.plus.com', 1);
INSERT INTO members VALUES (13, 'NS', 'Nightviper@gmail.com.', 1);
|
Not a clue 
|
|
|
|
06-08-2005, 01:34 AM
|
|
Posts: 9
Location: Savannah, GA
|
"Match" is a reserved word in MySQL. It shouldn't be used as a table name or column name.
If you are going to use it, every single reference to the table in every single query you write will likely need to be like this: `match`
This will work for you:
Code:
# phpMyAdmin MySQL-Dump
# version 2.4.0
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Jun 07, 2005 at 04:00 PM
# Server version: 4.1.8
# PHP Version: 5.0.4
# Database : `pcgf_matches`
# --------------------------------------------------------
#
# Table structure for table `match`
#
CREATE TABLE `match` (
`match_id` int(11) NOT NULL auto_increment,
`match_name` varchar(255) NOT NULL default '',
`match_date` varchar(255) NOT NULL default '',
`match_time` varchar(255) NOT NULL default '',
`match_m1` int(11) default NULL,
`match_m2` int(11) default NULL,
`match_m3` int(11) default NULL,
`match_m4` int(11) default NULL,
`match_m5` int(11) default NULL,
`match_m6` int(11) default NULL,
`match_ip` varchar(255) NOT NULL default '',
`match_pass` varchar(255) NOT NULL default '',
`match_done` int(11) NOT NULL default '1',
PRIMARY KEY (match_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table `match`
#
INSERT INTO `match` VALUES (1, '[Dragoon]', '30/5/05', '7PM', 1, 2, 3, 4, 5, 0, '85.133.16.53:27115', 'pcgfmatch', 2);
INSERT INTO `match` VALUES (2, 'ES', '03/06/05', '7:30pm', 1, 7, 3, 6, 8, 0, '85.133.16.53:27115', 'pcgfmatch', 2);
INSERT INTO `match` VALUES (3, '[BuM]', '5th June 2005', '', 1, 15, 12, 11, 13, 0, '85.133.16.61:27175', 'arse', 2);
# --------------------------------------------------------
#
# Table structure for table `members`
#
CREATE TABLE members (
member_id int(11) NOT NULL auto_increment,
member_name varchar(255) NOT NULL default '',
member_email varchar(255) NOT NULL default '',
member_status int(11) NOT NULL default '1',
PRIMARY KEY (member_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table `members`
#
INSERT INTO members VALUES (1, 'HitRaj 47', 'mrkill47@gmail.com', 2);
INSERT INTO members VALUES (12, 'invulnerable_pig', 'invulnerablepig@gmail.com', 1);
INSERT INTO members VALUES (15, 'Apeman', 'themonkeydude@gmail.com.', 2);
INSERT INTO members VALUES (11, 'Spartan', 'phawkins1988@gmail.com', 1);
INSERT INTO members VALUES (10, 'Drizzt Do\'Urden', 'tom.drizztdourden@gmail.com', 1);
INSERT INTO members VALUES (14, 'TRAFMAN', 'james@ferretti.plus.com', 1);
INSERT INTO members VALUES (13, 'NS', 'Nightviper@gmail.com.', 1);
|
|
|
|
|
« Reply to Exporting/Importing mysql database
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|