[mythtvnz] Frontend will not connect to database...

Nick Wallingford nick at wallingford.nz
Sat Oct 31 20:48:16 GMT 2015



On 31/10/15 18:54, Stephen Worthington wrote:
> On Sat, 31 Oct 2015 17:47:54 +1300, you wrote:
>
>>
>>
>> On 31/10/15 15:45, Stephen Worthington wrote:
>>> On Sat, 31 Oct 2015 12:45:27 +1300, you wrote:
>>>
>>>> Ubuntu 14.04
>>>> mythtv 0.27
>>>>
>>>> Combined FE and BE (ie, same PC) but specifying fixed IP in setup for
>>>> the BE and in config.xml for the FE.
>>>>
>>>> mysql seems OK - I can connect to the mythconverge as user mythtv
>>>> backend seems OK - it runs normally, with no abnormal errors in logs.
>>>>
>>>> But the frontend refuses to load, with the error:
>>>>
>>>> Connection to master server timed out. Either the server is down or the
>>>> master server settings in mythtv-settings does not contain the proper IP
>>>> address.
>>>> No address defined for host: localhost
>>>>
>>>> I'm not sure why it should be trying to use localhost - that point of
>>>> failure is, near as I understand, when the frontend is making the
>>>> initial contact with the DB using the config.xml information (and then
>>>> it gets all the other config stuff from the DB???)
>>>>
>>>> Anyone willing to give me some help before TV time starts later today???
>>>>
>>>> Nick Wallingford
>>>> Tauranga
>>>
>>> Is this Mythbuntu 14.04?  If so, then first check that mysql is bound
>>> to all IP addresses.  In my setup, that is done in
>>> /etc/mysql/conf.d/mythtv.cnf which looks like this:
>>>
>>> [mysqld]
>>> bind-address=0.0.0.0
>>>
>>> and in /etc/mysql/my.cnf the bind line is commented out by putting a #
>>> character at the front of it.
>>>
>>> If you do:
>>>
>>>     cd /etc/mysql
>>>     grep -ir bind *
>>>
>>> you should see all the bind settings:
>>>
>>> root at mypvr:/etc/mysql# grep -ir bind *
>>> conf.d/mythtv.cnf:bind-address=0.0.0.0
>>> conf.d/mythtv-tweaks-jsw.cnf:bind-address=0.0.0.0
>>> my.cnf:#bind-address            = 127.0.0.1
>>> my.cnf.original:bind-address            = 127.0.0.1
>>>
>>> If you change any settings, restart mysql.  Restarting mysql without
>>> stopping the backend is safe only if the backend is idle.  It is
>>> probably better to stop it first, so do this (from a root prompt or
>>> add sudo):
>>>
>>> stop mythtv-backend
>>> restart mysql
>>> start mythtv-backend
>>>
>>> Then check that the box itself has a static IP address.  And make sure
>>> what it is set to:
>>>
>>> ifconfig
>>>
>>> Then check that the static IP address is the one in the
>>> /etc/mythtv/config.xml file.
>>>
>>> Then check the same in any MythTV user directories eg:
>>>
>>>     /home/mythtv/.mythtv/config.xml
>>>     /home/<frontenduser>/.mythtv/config.xml
>>>
>>> Then check the MythTV settings for the same IP address in the backend
>>> and frontend settings.  If you do a mysql query like this you should
>>> see your backend settings:
>>>
>>> mysql> select * from settings where data like '10.0.2.4';
>>> +-----------------+----------+----------+
>>> | value           | data     | hostname |
>>> +-----------------+----------+----------+
>>> | MasterServerIP  | 10.0.2.4 | NULL     |
>>> | BackendServerIP | 10.0.2.4 | mypvr    |
>>> +-----------------+----------+----------+
>>> 2 rows in set (0.00 sec)
>>>
>>> And this will show if you have localhost set anywhere:
>>>
>>> mysql> select * from settings where data like '127.%' or data like
>>> 'localhost';
>>> Empty set (0.00 sec)
>>>
>>> _______________________________________________
>>> mythtvnz mailing list
>>> mythtvnz at lists.linuxnut.co.nz
>>> http://lists.ourshack.com/mailman/listinfo/mythtvnz
>>> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>>>
>>
>> Sorry.  Not mythbuntu but plain vanilla ubuntu with mythtv...
>
> Which uses the Mythbuntu packages for MythTV, so it will be very
> similar, just using a different desktop.
>
>> But all you said makes sense nevertheless.  I sort of figured my issues
>> were more mysql related rather than mythtv to some extent.
>>
>> But changing the various bind settings has my BE unable to connect to
>> the database.  I think my problems is with the mysql permissions for the
>> mythtv user.
>>
>>    Database error was:
>>    Access denied for user 'mythtv'@'media' (using password: YES)
>>
>> Reasonably comfortable with phpmyadmin or mysql command line - what
>> should I be looking for for that user?
>>
>> Thanks for helping - I *generally* manage to blunder my way to a
>> solution, but this one has had me stumped for most of the day!
>>
>> Nick
>
> I am not very good with mysql permissions at all.  So far I have found
> them to be a great mystery and I have avoided having anything to do
> with them.
>
> Take a look at:
>
>    https://www.mythtv.org/wiki/Category:MySQL
>    https://wiki.archlinux.org/index.php/MythTV#Setting_up_the_database
>
> and see if anything there helps.  There are examples of how to change
> permissions, but I have no idea if they will help your problem.
>
> See:
>
>    /usr/share/mythtv/sql/mc.sql
>
> for how the mythconverg database is initially created.
>
> Is "media" the name of the MythTV box?  If so, then maybe what you
> need is:
>
> GRANT ALL ON mythconverg.* TO 'mythtv'@'media' IDENTIFIED BY
> 'password';
> FLUSH PRIVILEGES;
>
> and also the same with the full domain name of media and maybe again
> with its IP address.
>
> Or maybe even:
>
> GRANT ALL ON mythconverg.* TO 'mythtv'@'%' IDENTIFIED BY 'password';
> FLUSH PRIVILEGES;
>
> Presuming that there is no Internet access to the MythTV box, the
> latter should be fine.
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
>

Well, that finally resulted in joy...

A combination of the various tips re: bind addr and permissions got the 
FE to trying to connect to the fixed BE IP  as it should.

So I've got it fixed again - all can return to me trying to troubleshoot 
some wireless AP issues now!

I think my problems were related to the bind addresses of mysql, and/or 
permissions for my database user.

Thanks, Stephen!

Nick
Tauranga






More information about the mythtvnz mailing list