LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   changing mysql data folder (https://www.linuxquestions.org/questions/linux-software-2/changing-mysql-data-folder-413580/)

Red Squirrel 02-09-2006 04:29 PM

changing mysql data folder
 
My data drive is only 10GB and my mysql data folder is getting rather big. So I want to move the /var/lib/mysql folder to /data2/mysql. So I did, no problem, everything copied. Then I found that /etc/my.cnf has the datadir parameter, so I changed it to reflect to the new path.

But when I try to start mysql, I get this (and there's nothing in the syslog)

Code:

borg:~# ser mysql start
Starting MySQL database server: mysqld...failed.
        Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
borg:~#

If I rename the /var/lib/mysql folder back it works, so for some reason, even after the changes I made in my.cnf, it's not taking affect.

Is there perhaps something else I need to edit as well?

bathory 02-09-2006 04:55 PM

Did you check the permissions in the new directory, i.e. make sure that it's rw for the user under which priviledges mysqld is running. Else you can create a symlink to see if it helps:
Code:

ln -s /data2/mysql /var/lib/mysql

Red Squirrel 02-09-2006 05:25 PM

Funny as I had the exact idea of creating a symlink, and that did not work either. But it was in fact a permission issue as they were owned by root and not mysql and only had rwx for user. So I changed the owner to mysql. Thanks for that tip as I did not even think of checking that.

bathory 02-09-2006 05:58 PM

Glad that I've helped

Cheers


All times are GMT -5. The time now is 03:53 PM.