[mythtv-users] mythtv cannot connect to database

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Jul 10 01:04:30 UTC 2020


On Thu, 9 Jul 2020 14:58:27 -0500, you wrote:

>On Thu, Jul 9, 2020 at 2:42 PM George Bingham <georgeb1962 at gmail.com> wrote:
>
>> Hello all,
>>
>> I've had a functioning 31 fixes combo fe/be running for a few weeks.
>>
>> Today I got frontend 31 installed on a laptop and so I am trying to enable
>> it to access the backend.
>>
>> To that end I know I have to set mysql to accept connections from the
>> network, but my attempts don't seem to be working.
>>
>> I have in /etc/mysql two "bind-address" lines, one in conf.d/mythtv.cnf,
>> and one in mysql.conf.d/mysqld.cnf. They are both set to the IP address of
>> my mythtv backend machine (where the database is running too).
>>
>> When I start either mythtv-setup, I get the screen where it's not able to
>> connect to the database.  Starting the backend similarly results in the
>> lines attempting to access the database repeatedly in the backend log file.
>>
>> Similarly, cannot connect from the frontend machine either.
>>
>> I CAN connect from the laptop (remote frontend) via mysql directly
>> however, so I know the database is running and able to accept networked
>> connections. I just don't know what's going wrong with either the backend
>> or the frontend not being able to connect.
>>
>> I am sure it's something simple, but currently at a loss!
>>
>> Help?
>>
>> Thanks,
>> -- George
>>
>
>Nevermind. Simply changing the "bind-address" to * instead of the IP
>address was the answer.
>
>Sorry to waste this valuable resource!

If you are using IPv6 on your network, you should use :: instead of *.

The reason that the backend was unhappy when you set a specific IP
address for the mysql bind-address was that you had not changed the IP
address the backend was connecting to so that it also used that
specific address.  So the backend was still trying to connect on
localhost (127.0.0.1) and mysqld was not listening on localhost any
more.  Leaving the backend connecting on localhost to mysql is good -
it gets a much faster connection that way.  Only external connections
should be using the external IP address to talk to mysql.

When you have more than one bind-address line in your mysql config
files, it is best to comment out one of them (put a # character at the
start of the line).  There is a specific order that the config files
are read in, and only one of those bind-address settings will actually
be working, which will be the last one that gets read.


More information about the mythtv-users mailing list