mysql, code to extract all content
Moderator: General Moderators
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
mysql, code to extract all content
Hi,
I'm looking for the mysql code to extract all datae (content only) from all tables.
Does someone know that code ?
Thanks a lot.
I'm looking for the mysql code to extract all datae (content only) from all tables.
Does someone know that code ?
Thanks a lot.
Extract or Export ? phpmyadmin
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
- orangeapple
- Forum Commoner
- Posts: 70
- Joined: Tue Jan 06, 2004 1:24 pm
- Location: Geneva / Switzerland
Ok, now I can create a backup file with the following script :
$sql_query = "SELECT * INTO OUTFILE 'c:/backup.sql' FROM login";
$result_sql_query = mysql_query($sql_query);
the result in the outfile is the following :
1 admin1 Fri 26th Mar 2004 06:56 pm Mon 10th May 2004 08:52 pm 1080323790
2 admin1 Tue 30th Mar 2004 07:48 pm Mon 10th May 2004 08:52 pm 1080668898
3 admin1 Tue 30th Mar 2004 08:48 pm Mon 10th May 2004 08:52 pm 1080672515
4 admin1 Mon 05th Apr 2004 08:48 pm Mon 10th May 2004 08:52 pm 1081190916
5 admin1 Mon 05th Apr 2004 08:59 pm Mon 10th May 2004 08:52 pm 1081191554
6 admin1 Mon 05th Apr 2004 09:09 pm Mon 10th May 2004 08:52 pm 1081192181
7 admin1 Mon 05th Apr 2004 09:10 pm Mon 10th May 2004 08:52 pm 1081192215
but this file is not usable for reloading as it should be :
INSERT INTO `login` VALUES (1, 'admin1', '', 'Fri 26th Mar 2004 06:56 pm', 'Mon 10th May 2004 08:52 pm', '1080323790');
INSERT INTO `login` VALUES (2, 'admin1', '', 'Tue 30th Mar 2004 07:48 pm', 'Mon 10th May 2004 08:52 pm', '1080668898');
INSERT INTO `login` VALUES (3, 'admin1', '', 'Tue 30th Mar 2004 08:48 pm', 'Mon 10th May 2004 08:52 pm', '1080672515');
INSERT INTO `login` VALUES (4, 'admin1', '', 'Mon 05th Apr 2004 08:48 pm', 'Mon 10th May 2004 08:52 pm', '1081190916');
INSERT INTO `login` VALUES (5, 'admin1', '', 'Mon 05th Apr 2004 08:59 pm', 'Mon 10th May 2004 08:52 pm', '1081191554');
INSERT INTO `login` VALUES (6, 'admin1', '', 'Mon 05th Apr 2004 09:09 pm', 'Mon 10th May 2004 08:52 pm', '1081192181');
INSERT INTO `login` VALUES (7, 'admin1', '', 'Mon 05th Apr 2004 09:10 pm', 'Mon 10th May 2004 08:52 pm', '1081192215');
like the export file in phpmyadmin.
How can i get the second format ready to reload ?
Tks !!
$sql_query = "SELECT * INTO OUTFILE 'c:/backup.sql' FROM login";
$result_sql_query = mysql_query($sql_query);
the result in the outfile is the following :
1 admin1 Fri 26th Mar 2004 06:56 pm Mon 10th May 2004 08:52 pm 1080323790
2 admin1 Tue 30th Mar 2004 07:48 pm Mon 10th May 2004 08:52 pm 1080668898
3 admin1 Tue 30th Mar 2004 08:48 pm Mon 10th May 2004 08:52 pm 1080672515
4 admin1 Mon 05th Apr 2004 08:48 pm Mon 10th May 2004 08:52 pm 1081190916
5 admin1 Mon 05th Apr 2004 08:59 pm Mon 10th May 2004 08:52 pm 1081191554
6 admin1 Mon 05th Apr 2004 09:09 pm Mon 10th May 2004 08:52 pm 1081192181
7 admin1 Mon 05th Apr 2004 09:10 pm Mon 10th May 2004 08:52 pm 1081192215
but this file is not usable for reloading as it should be :
INSERT INTO `login` VALUES (1, 'admin1', '', 'Fri 26th Mar 2004 06:56 pm', 'Mon 10th May 2004 08:52 pm', '1080323790');
INSERT INTO `login` VALUES (2, 'admin1', '', 'Tue 30th Mar 2004 07:48 pm', 'Mon 10th May 2004 08:52 pm', '1080668898');
INSERT INTO `login` VALUES (3, 'admin1', '', 'Tue 30th Mar 2004 08:48 pm', 'Mon 10th May 2004 08:52 pm', '1080672515');
INSERT INTO `login` VALUES (4, 'admin1', '', 'Mon 05th Apr 2004 08:48 pm', 'Mon 10th May 2004 08:52 pm', '1081190916');
INSERT INTO `login` VALUES (5, 'admin1', '', 'Mon 05th Apr 2004 08:59 pm', 'Mon 10th May 2004 08:52 pm', '1081191554');
INSERT INTO `login` VALUES (6, 'admin1', '', 'Mon 05th Apr 2004 09:09 pm', 'Mon 10th May 2004 08:52 pm', '1081192181');
INSERT INTO `login` VALUES (7, 'admin1', '', 'Mon 05th Apr 2004 09:10 pm', 'Mon 10th May 2004 08:52 pm', '1081192215');
like the export file in phpmyadmin.
How can i get the second format ready to reload ?
Tks !!