Monthly Archives March 2013

Move mysql data directory to new location

In theory, it’s very easy: In linux distributions, you first stop mysql: service mysqld stop Then, copy the entire data to the new location. Use -rv to make sure permissions etc. are copied as well: cp -rv /var/lib/mysql /home Next, make user mysql the owner: chown -R mysql:mysql /home/mysql Next, open the config file /etc/my.cnf […]