MySQL Forums
Forum List  »  General

Re: Rrunning mutliple mysql dump on single instance
Posted by: Keith Larson
Date: January 30, 2014 07:22PM

Could you do this just via a shell:

Create shell:
SELECT CONCAT('mysqldump --opt <DB_NAME> ', TABLE_NAME,' > ',TABLE_NAME,'.sql & ') as cmd
INTO OUTFILE '/tmp/mysqldump_queries.sh'
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA IN ('<DB_NAME>')
AND TABLE_TYPE = 'BASE TABLE'
AND TABLE_NAME NOT IN ( <Table lists here> );

Edit shell to add #!/bin/sh at the start:
Chmod +x /tmp/*.sh

Then you can run the dump and it will dump all tables in the background locally to wherever you run it.

But are you trying to do a select into OUTFILE but selecting field names and etc instead of an actually schema dump?
SELECT <fields>
INTO OUTFILE '/tmp/filename'
WHERE fields=something

Just trying to help....

http://anothermysqldba.blogspot.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Rrunning mutliple mysql dump on single instance
January 30, 2014 07:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.