restoring mysql databases from mysqldump was Re: upgrading mysql

Khairil Yusof kaeru at pd.jaring.my
Sat Aug 30 08:49:05 PDT 2003


On Sat, 2003-08-30 at 05:33, Michelle wrote:

Not really FreeBSD specific..but.. :)

> I ran mysqldump -A > backup-file.sql and then upgraded the mysql port, 
> but now when I try to restore the backups using mysql "database name"  
> < backup-file.sql, It states unknown database.  I also have a 
> mysqlhotcopy backup of all my databases.  Am I doing something wrong 
> when trying to recover multiple databases?  How can I recover them from 
> the mysqlhotcopy rather then the dump if something went wrong with the 
> dump?

mysqldump -A will save all databases, so when restoring you only need:

mysql < backup-file.sql

not:

mysql "database name" < backup-file.sql

This will try to restore only one database (which you need to create
first). This ways is only needed if you do a mysqldump "databasename" >
backup.sql.


--
"Optimized, readable, on time; Pick any two." 

FreeBSD 5.1-CURRENT i386 
11:45PM up 1 day, 1:43, 4 users, load averages: 1.33, 1.47, 1.41
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030830/8a8128ea/attachment.bin


More information about the freebsd-questions mailing list