Make mysqldump output USE statements or full table names when dumping a single table with where clause

Posted by tobyodavies on Server Fault See other posts from Server Fault or by tobyodavies
Published on 2011-12-01T01:27:34Z Indexed on 2011/12/01 1:59 UTC
Read the original article Hit count: 535

Filed under:
|

Is it possible to get mysqldump to output USE statements for a single (partial) table dump?

I've already got some scripts that I'd like to reuse which run mysqldump with some arguments and apply them to a remote server.

However, since I haven't bothered to parse all the arguments to mysqldump, and there is no USE in the dump, the remote server is saying no database selected.

I'm a programmer more than anything else, so I can easily use sed to modify the dump before applying it in the worst case, but those scripts won't allow me to do this as I don't have access to the dump between creation and application.

EDIT: the ability to output fully qualified table names may also solve my problem

© Server Fault or respective owner

Related posts about mysql

Related posts about mysqldump