  | |  | MySQL | MySQL 2005-03-21 - By Ed Wilts
Back On Mon, Mar 21, 2005 at 11:14:39AM -0800, Rob wrote: > I have a RHEL3 server where I installed a MySQL rpm from MySQL rather > than from RedHat. Now I want to move all of this to the RH standard > packeges so I can keep up on it better. If I uninstall my rpm and > install the one from RHN am I going to loose my databases? Is is there > a simple backup/resore procedure for my dbs including the mysql > database?
Here's the approach I would take (and I'm not saying it's right!): 1. rpm -q mysql-server --scripts This tells you what will happen when you remove the package. Not only will the files in your original rpm be removed, but some scripts will be executed. 1a. Ditto for mysql 2. service mysqld stop This shuts down the mysql server 3. copy /etc/my.cnf 4. copy the contents of /var/lib/mysql to a safe place. Note that the databases may be in a different place. /etc/my.cnf will tell you. 5. rpm -e the original mysql packages and rpm -i the new ones. Restore /etc/my.cnf
In theory, you should not lose any databases. I've successfully moved databases from one system to another just by rsync'ing the /var/lib/mysql/<databasename> from one system to another.
It never hurts to have good backups of your databases anyway. I've been using a script called automysqlbackup (http://members.lycos.co.uk/wipe_out/automysqlbackup/) and it works like a charm. I've restored a database to another system using it.
.../Ed
-- Ed Wilts, RHCE Mounds View, MN, USA mailto:ewilts@(protected) Member #1, Red Hat Community Ambassador Program
-- Taroon-list mailing list Taroon-list@(protected) http://www.redhat.com/mailman/listinfo/taroon-list
Earn $52 per hosting referral at Lunarpages.
|
|
 |