How do I insert several entries into a table from the editor

[expired user #3381]'s profile image [expired user #3381] posted 16 years ago in General Permalink
I am trying to restore a MySQL 5 database but I keep getting errors but since I just have to restore several lines I thought I could insert them using the editor.

The table is already created.

What other syntax do I need besides this:

INSERT INTO `mytable` VALUES (1081, 980, 'Steve Miller', '', '', '', , '', '', '', , , , '') ;
ansgar's profile image ansgar posted 16 years ago Permalink
There are several quotes missing in some values. How did you create this INSERT?
[expired user #3381]'s profile image [expired user #3381] posted 16 years ago Permalink
Anse,

I used a Wordpress plugin to create the backup - more on that here:
http://www.davecolorado.com/index.php/wordpress-mysql-scheduled-backup-warning/

I am not sure if I am missing quotes or not.

How can I just insert several lines using the SQL editor?

Can't I just do something like this:

INSERT INTO `pm` VALUES (978, '', '', '', '', '', '', 'http://www.', '', 0, 0, '', 2008-03-05 22:45:33, 0, 44, 600, '35.207255,-101.833894', 9, 1, 0) ;
INSERT INTO `pm` VALUES (979, 'test', '', '', '', '', '', 'http://www.', '', 0, 0, '', 2008-03-06 07:41:39, 0, 34, 467, '35.2225, -80.837539', 10, 0, 0) ;
INSERT INTO `pm` VALUES (980, 'test', '', '', '', '', '', 'http://www.', '', 0, 0, '', 2008-03-06 12:39:38, 0, 6, 110, '33.81452532651738, -118.17237854003906', 12, 0, 0) ;

Is it required to drop or create a table first?
ansgar's profile image ansgar posted 16 years ago Permalink
In principle that's correct, but also in these statements there are missing some single quotes - the date and time values have to be quoted:
INSERT INTO `pm` VALUES (978, '', '', '', '', '', '', 'http://www.', '', 0, 0, '', '2008-03-05 22:45:33', 0, 44, 600, '35.207255,-101.833894', 9, 1, 0);


I guess you should not use this plugin for backing up your data, rather use HeidiSQL or mysqldump.exe .
[expired user #3381]'s profile image [expired user #3381] posted 16 years ago Permalink
You can bet after the day I had yesterday I will not be using that plugin ever again.

Thanks I will try the quotes.

I used MySQL Admin dump last night and my test restore worked great.

Please login to leave a reply, or register at first.