Web Hosting Talk







View Full Version : Move MySQL to /home/mysql - FROM /var/lib/mysql????


Addict
03-14-2002, 04:48 PM
I have moved my databases to the /home/mysql directory from the default /var/lib/mysql.

I provided a symlink to the new location.

PROBLEM: now, phpMyAdmin no longer works.

The variables in phpMyAdmin still show /var/lib/mysql as the 'datadir'.

QUESTIONS:

1. Is moving these databases in any way harmful (ie. do you think I screwed up?)

2. How do I change the datadir? (I don't have a 'my.cfg' file)

3. Are there any other places that are going to mess with me on this move (like phpMyAdmin did).

4. Anything esle I should know?

Thanks for the help - again ;)

jahsh
03-14-2002, 06:58 PM
if you dont already have a my.cnf in your /etc make one, here is what a basic one looks like:

[root /etc]# cat my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=
password=
database=
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

then start mysql with:
/etc/rc.d/init.d/mysql restart

you might need this option :
mysql --defaults-file=/etc/my.cnf
(it should read this file by default anyway though)