Re: [OT] a mysql question

2006-10-25 Thread Chris


On Oct 24, 2006, at 6:52 PM, jan gestre wrote:


On 10/25/06, Jonathan Horne <[EMAIL PROTECTED]> wrote:


i do know how to import a .sql database dump, i was just wondering  
if i

can do
it via a restore job from netbackup.  any opinions i can get, are  
greatly

appreciated.


to backup a mysql database:

$ mysqldump -u user -p --opt databasename > database.bak.sql

to restore a database from the backup:

$ mysql -u user -p database < database.bak.sql

just make sure user has privileges to do the necessary commands, if  
not you
can use the root user of mysql. you can also use a gui tool like  
phpmyadmin

for managing mysql.


Just an extra detail. Be sure that you not only do a mysqldump for your
application databases but also dump the "mysql" database so you don't
lose any internal permission records you've created. You or your apps
will have likely created records in that database necessary for when you
attempt to actually use your restored application databases. The  
resulting

dump will need to be edited before you try to recover since your setup
of mysql on the restored server will automatically create the  
structures.

The dump file will duplicate the creation (not good). Get around that by
deleting everything in that dump file except the INSERT statements for
records you've created. They will usually be somewhat obvious, e.g.,
you may have an entry for "daemon" if a webserver cgi application has
been granted access to some database.

The records you will be interested in backing up
are from the database "mysql" and the table called "user". These must
be restored after you restore the application databases in most cases
since they refer to the existence of the application database.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: [OT] a mysql question

2006-10-24 Thread jan gestre

On 10/25/06, Jonathan Horne <[EMAIL PROTECTED]> wrote:


typical OT thread apologies, but the truth *really* is that this is the
best
and most intelligent list i read. so...

i use veritas netbackup 5.1 to backup my bsd machines, and i would like to
restore some mysql databases onto another machine.  is restoring any mysql
database, as simple as reloading the database directories in
/var/db/mysql?
do i need to create the blank database first, then do it?

i do know how to import a .sql database dump, i was just wondering if i
can do
it via a restore job from netbackup.  any opinions i can get, are greatly
appreciated.

i'm not a mysql guru but backing up and restoring a mysql database is just

like riding a bike, it's that easy :D

to backup a mysql database:

$ mysqldump -u user -p --opt databasename > database.bak.sql

to restore a database from the backup:

$ mysql -u user -p database < database.bak.sql

just make sure user has privileges to do the necessary commands, if not you
can use the root user of mysql. you can also use a gui tool like phpmyadmin
for managing mysql.

cheers
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: [OT] a mysql question

2006-10-24 Thread Philip Hallstrom

typical OT thread apologies, but the truth *really* is that this is the best
and most intelligent list i read. so...


You're really going to get better answers from the mysql lists... really. 
:)



i use veritas netbackup 5.1 to backup my bsd machines, and i would like to
restore some mysql databases onto another machine.  is restoring any mysql
database, as simple as reloading the database directories in /var/db/mysql?
do i need to create the blank database first, then do it?


maybe. maybe not.  depends on the engine's used.

http://dev.mysql.com/doc/refman/5.0/en/backup.html
http://jeremy.zawodny.com/mysql/mysql-backup-and-recovery.html

-philip
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"