Import one database instead of all from sql dump

  • Written by
    Herman Bos
  • Published on

Ever needed to restore only one database on a MySQL server and found out you only had one SQL dump containing all databases?

Its quite common to dump all databases in one SQL file (mysqldump –all-databases or -A). But when using multiple databases on one MySQL instance you often need to restore just one of them.

The minimal effort solution:

mysql --one-database desired_db_name < alldatabases.sql

fix!


Back to overview Newer post: squirrelmail / clicking on empty subject Older post: compose key / irony punctuation / x11