[mythtv-users] Is it possible to move the MySQL directories or: My doesn't Mythbackend start anymore?

Paul Barker myth at sixtimesnine.net
Sun Jul 30 06:52:36 UTC 2006


Mike Vega wrote:
> Gert-Jan Bilt, van de wrote:
>   
>> All,
>>
>> I was forced to move my MySQL base directory from /var/lib/mysql to /opt/data/mysql on a Linux box. After changing the /etc/my.cnf and the /etc/init.d/mysqld files to reflect this change of directories I can log into the MySQL server like before.
>>
>> However, mythbackend can not!
>>
>> The error message I get is the following: 
>> QMYSQL3: Unable to connect
>> Database error was:
>> Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
>>
>> Which obviously is true, since this directory and this file no longer exists. 
>>
>> My question: Why can I log into the mysql database without any problem if I do it manually with the mythtv user, but why can mythbackend not log in. Does mythbackend have some sort of hardcoded reference to this /var/lib/mysql/mysql.sock file? 
>>
>> Anybody know?
>>
>> GJ
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>>   
>>     
> Here is a page from the MySQL docsd talking about this very item:
>
>     Another approach is to change the place where the server creates the
>     Unix socket file. If you do this, you should also let client
>     programs know the new location of the file. You can specify the file
>     location in several ways:
>
>         *
>
>           Specify the path in a global or local option file. For
>           example, put the following lines in |/etc/my.cnf|:
>
>           [mysqld]
>           socket=/path/to/socket
>
>           [client]
>           socket=/path/to/socket
>                 
>   

That's the bit you need. Make sure that in my.cnf the socket= entry 
points to your new location /opt/data/mysql/mysql.sock and then restart 
the mysql service. If you have entries for mysqld and client make sure 
the entry is the same. You may need to explicitly set a socket= in the 
client part if there isn't and entry otherwise mysql connections may try 
to use the default.

Cheers
Paul


More information about the mythtv-users mailing list