backup mysql

Ilya Palagin tux-4CS0UopE6WdBDgjK7y7TUQ at public.gmane.org
Wed Nov 3 14:31:23 UTC 2004


Quoting Zbigniew Koziol <zkoziol-Zd07PnzKK1IAvxtiuMwx3w at public.gmane.org>:

> Noah John Gellner wrote:
> > I continue to have problems with mozilla crashing on certain sites. I
> > know that a complete reinstall will fix the problem but have no idea
> > why. Be that as it may, one result of reinstalling my OS is that I will
> > be reinstalling mysql. I currently have databases set up for the Horde,
> > Egroupware, and Wordpress. I would rather not redo all of this work.
> >
> > How do I archive my mysql settings and database so that I can easily
> > restore onto my new OS install? If it is helpful, I am running Gentoo.
>
> man mysqldump -- will explain how to create backup copy. Use for that a
> mysql useraccount that has access to reading all data, so possibly root).

mysqldump --user=$MYSQLUSER --password=$MYSQLPASS --opt --host=$MYSQLHOST
--all-databases > full_mysql_backup.sql

> After that:
> mysql -uroot -p < mysql-dump.sql -- will restore all databases dumped,
> together with privileges tables (if were backuped properly).
>

One can get restore errors even if database was backed up properly.  Usually it
means that tables to be restored contain field names, which belong to reserved
words (for instance, Cerberus Helpdesk has this problem). Those fields have to
be escaped with backticks before restore can be completed.

Ilya.


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list