MySQL 5.1 on Debian 6
Set up MySQL with a customized data directory and secure the installation with default provided scripts.
# apt-get install mysql-server mysql-client # mysql_secure_installation # /etc/init.d/mysql stop # mkdir /home/mysql # usermod -d /home/mysql mysql # mv -R /var/lib/mysql/* /home/mysql
edit /etc/mysql/my.cnf:
... datadir = /home/mysql ...
Now start MySQL server again
# /etc/init.d/mysql start
If something went wrong, mysql won’t start. Check log files for more details.