Is it possible to have phpmyadmin or other tool to import a csv or sql backup into an existing DB and skip the primary key or is this a manual, table by table process of inserting with queries and manually removing the primary key?
+1
A:
Many ways lead to Rome: 1 way:
LOAD DATA LOCAL INFILE 'file.txt'
INTO TABLE t1 (column1, column2, column3);
another way:
CREATE TABLE `import` (
`column1` int(11) NOT NULL,
`column2` varchar(128) NOT NULL,
`column3` varchar(128) NOT NULL
) ENGINE=MyISAM CHARSET=utf8;
LOAD DATA LOCAL INFILE 'file.txt'
INTO TABLE import
(column1, column2, column3);
INSERT INTO destination_table (columnA,columnB,columnC)
SELECT column3, column1, column2 FROM import;
Tom Schaefer
2009-03-30 19:25:18