Move MYSQL

Titam

Verified User
Joined
Apr 29, 2005
Messages
168
Hello,

I'm running with FC3 and latest version of DA.

I would like to change my MySQL databases (at this time, they are on /var/lib , on a partition of 2 Go. It's not enough.

I would like to put them on /home/mysql/

Is it possible to do this easyly and how to do that ?

Thanks a lot :)

-- Titam
 
Are they on /var/lib, or a subdirectory of /var/lib?

If they're in /var/lib you'll have to move the entire /var/lib directory, but if they're in a subdirectory you can just move the directory.

For example:

If they're in /var/lib/mysql and you want to move them to /home/mysql this is how I'd do it on RHEL:

# service mysqld stop
# mv /var/lib/mysql /home
# ln -s /home/mysql /var/lib/mysql
# service mysqld start

Jeff
 
Yes, in fact it is /var/lib/mysql

It's just that ? Cool ^^

Thank you very much :)
 
You're welcome.

Be sure to test when you're done. Everything should work. If something doesnt, you should just move the directory back and restart again.

Jeff
 
Hi !

I did this today and ... after mv, DA works fine, but nothing else work. What can i do ? is it a problem with the ln ?
 
I found a solution, temporarly, i'm waiting you mind.

I edit my.cnf and i changed :
[client]
socket = /var/lib/mysql/mysql.sock

by
[client]
socket = /home/mysql/mysql.sock

And I let [mysqld] socket = /var/lib/mysql/mysql.sock

and website can now access to mysql databases, but is-it ok now ? or is it possible I have other problem ?
 
Last edited:
If my suggestion doesn't work it's because for some reason MySQL doesn't like traversing the link.

So your method would be a good fix.

But you should still leave the links in, as DA will probably follow them.

Test. Test. Test.

Including creating new databases, backing up, etc.

Jeff
 
I tested without change for DA (delete, create, backup, export) and no problem
 
Back
Top