I need to move my data directory to a bigger drive on the same server.
# stop mysql /etc/init.d/mysql stop # copy the data over cp -R -p /var/lib/mysql /home/mysql #edit my.cnf # and add a 'datadir' section with the new path. #restart mysql /etc/init.d/mysql restart
The copying of the data will take ages, (I suspect), but at least it will be safe.
I might also want to add a temp directory somewhere.
Do I need to do anything else to move the data.
Will I need to rebuild indexes or something else?