Mittwoch, 21. Mai 2008

Change database directory of mysql

For me it is easier that the default database directory is not /var/lib/mysql/ but rather in home partition. A solution is given here http://developer.spikesource.com/wiki/index.php/How_to_change_the_mysql_database_location. To notice that, the default configration file is /etc/mysql/my.cnf. On ubuntu 7.10, things are little different, so I have taken the following steps:
  1. mysqladmin -u root -p shutdown
  2. change datadir = ${datadir} in my.conf
  3. ugly setting set chmod -R a+x ${datadir}
  4. sudo mysqld_safe &