[imp] OFF TOPIC: how to migrate mysql data
Miroslaw Jaworski
mjaw at ipartners.pl
Wed Feb 12 14:43:52 PST 2003
* Bruno Negrao (imp-bnegrao at engepel.com.br) [030212 14:13] wrote:
> Hi all,
>
> I need to copy the horde_prefs table from one server to another. I created
> in the new server the horde table with the same settings as the horde table
> of the first server.
>
> How can I do this? (please, tell me the complete commands because I don't
> understand nothing about databases...)
This should do the trick:
mysqldump -c -h 127.0.0.1 -u horde2mgr -p horde2 horde_prefs > horde_prefs.dump
-c - complete insert statements
-t - dont enclose "create table" statements
-h - database host to connect to ( you may need to change it )
-u - database user ( you may need to change it )
-p - use password ( you'll be asked for it after entering the command )
horde2 - database name ( you may need to change it )
horde_prefs - table which data will be dumped
horde_prefs.dump - filename where the data will be dumped
Depend on your installation you may not need -h 127.0.0.1 ( i always use
chroot'ed environements for everything, so even when whole webmail is one
machine installation, i cannot connect using default socket file; only
through a loopback )
After having data in horde_prefs.dump, do the following:
mysqldump -h 127.0.0.1 -u horde2mgr -p anotherdatabase < horde_prefs.dump
Again, you'll be asked for the password after entering the command
switches meaning is identical.
Regards
M.
--
Miroslaw.Jaworski at gts.pl ( Psyborg ) MJ102-RIPE GTS Internet Partners SA
Servers Administration Department Manager
More information about the imp
mailing list