Move MySQL DB to another place?

Hello!

It happens so that soon I am running out from my /var partition, where databases are now. I have CentOS3.3 and MySQL 4.1

On MySQL site I read that it is possble to move one of databases to another disk and instead put symbolic link into mysql directory.

I tried a few times to do like this:

I have:
datadir=/var/lib/mysql
database for example "test" in the datadir.

Then I move the test, which contains my database test to another disk (mounted under /opt):

mv test /opt/
then
ln -s /opt/test /var/lib/mysql/test
chown mysql:mysql /var/lib/mysql/test

and then acording to MySQL description it should work
Actually I read about such technique in a few places.

But it does not work!!!

If I check with PHPMyAdmin or even directly in mysql with command
show databases;
it does not show any database!!!

Also ls -la in
/var/lib/mysql shows link test


I tried to do the same with whole directory /var/lib/mysql and moved it to another disk, cretaed link instead....

nothing helps.....

Have you guys some idea what is wrong?

Or is it possible somehow to install MySQL from rpm to another place. I tried to compile myself, but result become quite difficult to configure, I prefer preconfigured rpm installation

thanks,

javafaq1

 

 

 

 

Top