Web Hosting Talk







View Full Version : Move MySQL Databases


trafficg
05-08-2002, 05:25 AM
Hi all,

I want to move all the MySQL databases to a different location on my cpanel based server, is this the correct procedure?


# stop services
/etc/rc.d/init.d/chkservd stop
/etc/rc.d/init.d/mysql stop


# double check mysql has stopped
ps aux|grep mysql

# copy databases to a new location
cp -r /var/lib/mysql /newpath/mysql


alter /etc/my.cnf

change
datadir=/var/lib/mysql
to
datadir=/newpath/mysql


# restart services
/etc/rc.d/init.d/mysql start
/etc/rc.d/init.d/chkservd start



Do I need to do anything else or modify any other files?



Thanks
Pete

eva2000
05-09-2002, 04:19 AM
hey Pete :)

should be fine