Are you using something like mysqldump to do backups? Usually, right after the CREATE DATABASE sql, there is another statement like USE 'databasename' which switches to the newly created database. <br><br>Basically the SQL would apply to whatever database the last USE 'db' was done for.
<br><br>As long as the dump file has all the correct CREATE and USE statements in the right order (which they would assuming you use something like mysqldump), you can run almost the same command to restore the databases, just without a specific database name:
<br><br>mysql --user=username --pass=password --host=dbserver < /path/file.sql<br><br>nick<br><br><div><span class="gmail_quote">On 2/25/07, <b class="gmail_sendername">Emil Edeholt</b> <<a href="mailto:emil@knmedical.se">
emil@knmedical.se</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello!<br><br>I hope this is not off topic. When I restore one database from an sql
<br>file I run:<br><br>mysql --user=username --pass=password --host=dbserver database <<br>/path/file.sql<br><br>But now I have one big sql file with all my databases and a CREATE<br>DATABASE for every database.<br><br>
How do I import this sql file into mysql so all databases are restored?<br>(So I won't have to update my backup script everytime I add a database<br>in mysql).<br><br>I hope I explained this clearly enough... Thanks for your time!
<br><br>Best regards Emil<br><br>--<br>ubuntu-users mailing list<br><a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br>Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users">
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br></blockquote></div><br>