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

Mike Vega druidfyr at gmail.com
Sat Jul 29 13:36:25 UTC 2006


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
                

          See Section 4.3.2, “Using Option Files”
          <http://dev.mysql.com/doc/refman/4.1/en/option-files.html>.

        *

          Specify a |--socket| option on the command line to
          *mysqld_safe* and when you run client programs.

        *

          Set the |MYSQL_UNIX_PORT| environment variable to the path of
          the Unix socket file.

        *

          Recompile MySQL from source to use a different default Unix
          socket file location. Define the path to the file with the
          |--with-unix-socket-path| option when you run *configure*. See
          Section 2.9.2, “Typical *configure* Options”
          <http://dev.mysql.com/doc/refman/4.1/en/configure-options.html>.

    You can test whether the new socket location works by attempting to
    connect to the server with this command:

    shell> *|mysqladmin --socket=/path/to/socket version|*

      

Looks like the enviro variable should work. Also that "[client]" option 
looks very interesting.

Hope this helps.

DruidFyr



More information about the mythtv-users mailing list