Re: How to restore 1 database from mysqldump of all databases

2007-07-11 Thread waldo_tumanut
Thanks to all who have replied.  Since this thread has evolved into
discussing the dump, I would like to ask the group what are their practices
for backup and recovery on Windows platform.

Waldo Tumanut
Database Analyst



   
"Mogens
Melander"  
<[EMAIL PROTECTED] To 
oft.dk>  "Rolando Edwards" 
 <[EMAIL PROTECTED]>   
07/10/2007  cc 
06:25 PM "waldo tumanut"   
 <[EMAIL PROTECTED] 
 m>, mysql@lists.mysql.com 
   Subject 
             Re: How to restore 1 database     
             from mysqldump of all databases   
   
   
   
   
   
   




A quick script solution:

create a dump pr. table in .

#!/bin/bash

for tbl in `echo "use ;show tables;"|mysql -s -u  -p`
do
  mysqldump -u  p db $tbl > $tbl.sql
done

and the other way:

cat | mysql -u  -p 






CONFIDENTIALITY NOTICE: This electronic mail transmission (including any 
accompanying attachments) is intended solely for its authorized recipient(s), 
and may contain confidential and/or legally privileged information. If you are 
not an intended recipient, or responsible for delivering some or all of this 
transmission to an intended recipient, be aware that any review, copying, 
printing, distribution, use or disclosure of the contents of this message is 
strictly prohibited. If you have received this electronic mail message in 
error, please contact us immediately by electronic mail at [EMAIL PROTECTED] 
and destroy the original and all copies of this transmission (including any 
attachments).

Thank you.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to restore 1 database from mysqldump of all databases

2007-07-10 Thread Mogens Melander
A quick script solution:

create a dump pr. table in .

#!/bin/bash

for tbl in `echo "use ;show tables;"|mysql -s -u  -p`
do
  mysqldump -u  p db $tbl > $tbl.sql
done

and the other way:

cat | mysql -u  -p 

On Tue, July 10, 2007 15:47, Rolando Edwards wrote:
> When the mysqldump ran against all databases, the USE  command
> should have appeared above each section of that databases dump. Try using
> Perl or the head or tail Unix command to hunt down the Database you are
> dumping. Read all lines until the next USE  command.
>
> Example: If you mysqldumped databases DB1, DB2 (copyright IBM), DB3, DB4,
> and DB5
> and you want ot restore just DB3, locate the string "USE DB3" (say its
> line 20)
> and "USE DB4" (say its line 25). Copy lines 20 to 25 to
> another SQL script.
> Then run that new script.
>
>
> - Original Message -
> From: "waldo tumanut" <[EMAIL PROTECTED]>
> To: mysql@lists.mysql.com
> Sent: Tuesday, July 10, 2007 9:34:28 AM (GMT-0500) America/New_York
> Subject: How to restore 1 database from mysqldump of all databases
>
>
> Question: How do I restore 1 database from amysqldump of all databases?
>
> Obviously a newbie.  I've searched the list but couldn't find the answer.
> Can someone help?
>
> Waldo Tumanut
> Database Analyst
>
>
> 
> CONFIDENTIALITY NOTICE: This electronic mail transmission (including any
> accompanying attachments) is intended solely for its authorized
> recipient(s), and may contain confidential and/or legally privileged
> information. If you are not an intended recipient, or responsible for
> delivering some or all of this transmission to an intended recipient, be
> aware that any review, copying, printing, distribution, use or disclosure
> of the contents of this message is strictly prohibited. If you have
> received this electronic mail message in error, please contact us
> immediately by electronic mail at [EMAIL PROTECTED]
> and destroy the original and all copies of this transmission (including
> any attachments).
>
> Thank you.
> 
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to restore 1 database from mysqldump of all databases

2007-07-10 Thread Dwalu Z. Khasu
On Tue, 10 Jul 2007 [EMAIL PROTECTED] wrote:

=>Thanks for your response, Rolando.  I know all the DML to create the
=>database is in the mysqldump.  I was looking for a command or command
=>options, if there are any, to extract the DML for the database, like what
=>you can do with mysqlbinlog.
=>
=>
Should be mysqldump --no-data  (or -d) -- Try mysqldump --help.
-- 
- Dwalu
.peace
--
I am an important person in this world -
Now is the most important time in my life -
My mistakes are my best teachers -
So I will be fearless.
- Student Creed

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to restore 1 database from mysqldump of all databases

2007-07-10 Thread waldo_tumanut
Thanks for your response, Rolando.  I know all the DML to create the
database is in the mysqldump.  I was looking for a command or command
options, if there are any, to extract the DML for the database, like what
you can do with mysqlbinlog.

- Message from Rolando Edwards <[EMAIL PROTECTED]> on Tue, 10 Jul 2007
09:47:15 -0400 (EDT) -
   
   To: waldo tumanut <[EMAIL PROTECTED]>   
   
   cc: mysql@lists.mysql.com   
   
  Subject: Re: How to restore 1 database from mysqldump of all databases   
   

When the mysqldump ran against all databases, the USE  command
should have appeared above each section of that databases dump. Try using
Perl or the head or tail Unix command to hunt down the Database you are
dumping. Read all lines until the next USE  command.

Example: If you mysqldumped databases DB1, DB2 (copyright IBM), DB3, DB4,
and DB5
and you want ot restore just DB3, locate the string "USE DB3" (say its line
20)
and "USE DB4" (say its line 25). Copy lines 20 to 25 to another
SQL script.
Then run that new script.




CONFIDENTIALITY NOTICE: This electronic mail transmission (including any 
accompanying attachments) is intended solely for its authorized recipient(s), 
and may contain confidential and/or legally privileged information. If you are 
not an intended recipient, or responsible for delivering some or all of this 
transmission to an intended recipient, be aware that any review, copying, 
printing, distribution, use or disclosure of the contents of this message is 
strictly prohibited. If you have received this electronic mail message in 
error, please contact us immediately by electronic mail at [EMAIL PROTECTED] 
and destroy the original and all copies of this transmission (including any 
attachments).

Thank you.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to restore 1 database from mysqldump of all databases

2007-07-10 Thread Rolando Edwards
When the mysqldump ran against all databases, the USE  command should 
have appeared above each section of that databases dump. Try using Perl or the 
head or tail Unix command to hunt down the Database you are dumping. Read all 
lines until the next USE  command.

Example: If you mysqldumped databases DB1, DB2 (copyright IBM), DB3, DB4, and 
DB5
and you want ot restore just DB3, locate the string "USE DB3" (say its line 
20)
and "USE DB4" (say its line 25). Copy lines 20 to 25 to another SQL 
script.
Then run that new script.


- Original Message -
From: "waldo tumanut" <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Sent: Tuesday, July 10, 2007 9:34:28 AM (GMT-0500) America/New_York
Subject: How to restore 1 database from mysqldump of all databases


Question: How do I restore 1 database from amysqldump of all databases?

Obviously a newbie.  I've searched the list but couldn't find the answer.
Can someone help?

Waldo Tumanut
Database Analyst



CONFIDENTIALITY NOTICE: This electronic mail transmission (including any 
accompanying attachments) is intended solely for its authorized recipient(s), 
and may contain confidential and/or legally privileged information. If you are 
not an intended recipient, or responsible for delivering some or all of this 
transmission to an intended recipient, be aware that any review, copying, 
printing, distribution, use or disclosure of the contents of this message is 
strictly prohibited. If you have received this electronic mail message in 
error, please contact us immediately by electronic mail at [EMAIL PROTECTED] 
and destroy the original and all copies of this transmission (including any 
attachments).

Thank you.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



How to restore 1 database from mysqldump of all databases

2007-07-10 Thread waldo_tumanut

Question: How do I restore 1 database from amysqldump of all databases?

Obviously a newbie.  I've searched the list but couldn't find the answer.
Can someone help?

Waldo Tumanut
Database Analyst



CONFIDENTIALITY NOTICE: This electronic mail transmission (including any 
accompanying attachments) is intended solely for its authorized recipient(s), 
and may contain confidential and/or legally privileged information. If you are 
not an intended recipient, or responsible for delivering some or all of this 
transmission to an intended recipient, be aware that any review, copying, 
printing, distribution, use or disclosure of the contents of this message is 
strictly prohibited. If you have received this electronic mail message in 
error, please contact us immediately by electronic mail at [EMAIL PROTECTED] 
and destroy the original and all copies of this transmission (including any 
attachments).

Thank you.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]