[nzlug] Restore MySQL database
Craig Box
craig at dubculture.co.nz
Fri Oct 6 13:36:02 NZDT 2006
Michael Dittmer wrote:
> Hi All
>
> I have to restore a MySQL database, except I'm having trouble. The
> command I'm using is mysql -u [username] -p [password] [wikidb] <
> [wiki_backup.sql]
>
> The MySQL file I have is a complete dump of the server using
> mysqldump.
> I only want to restore one database from the dump file.
>
> Does anyone know restore just a single database?
As pointed out, just edit the SQL file to say what you want.
My reply is to point out you can't specify the password on the command line
with -p - you are saying "prompt for a password", and then "act on the
database "password".
You want --password=password if you're going to specify.
This has tripped me up before!
Craig
More information about the NZLUG
mailing list