Page 1 of 1

changing mysql datadir

PostPosted: 22. April 2008 19:28
by korg
Hi,

I was wondering how to change the default mysql datadir. I noticed that the setting was not in /etc/my.cnf. I also noticed that the datadir seems to be set during startup when I issue ./lampp start, because checking my processes shows : .../opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql...

Is there a way to change this startup option or is there any file I can edit to change the datadir?

Also, after I change the datadir, can I simply move the files in the current datadir over and mysql should keep working?

Thanks

PostPosted: 07. May 2008 19:12
by korg
anyone?

PostPosted: 07. May 2008 22:58
by korg
i figured it out, in your lampp dir, in /etc/my.cnf, add a datadir=/path/to/new/datadir/

copy all the current files in /var/mysql into the new datadir

make sure to chown and chgrp -R the new folder to nobody

after that restart lampp and it should work