All remote frontends unable to connect to backend database

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
martynbottomley
Newcomer
Posts: 12
Joined: Wed Dec 28, 2016 9:53 pm
Great Britain

All remote frontends unable to connect to backend database

Post by martynbottomley » Sun Feb 10, 2019 5:24 pm

I have a server running Ubuntu 18.04.2 and Mythtv v0.29

The server has a backend and frontend. I have three remote frontends also accessing the server backend

All have been working well for many weeks

I am not aware of any software changes being made but all three remote frontends can no longer connect to the backend database, but the server frontend continues to work fine

I have checked various files and settings to make sure remote access should be possible:-

/etc/mysql/conf.d/mythtv.cnf - I have tried the bind-address with the server IP address (192.168.1.67), 0.0.0.0 and ::
/etc/mysql/my.cnf - the bind address is set to 0.0.0.0
/etc/mythtv/config.xml - the host element is set to localhost

The server frontend setup hostname is set to localhost
The server backend setup host security pin is set to 0000
Listen on all IP addresses is ticked

The remote frontend setup hostname is set to the IP address of the server (192.168.1.67)

I have run out of ideas. Can anyone offer some remote frontend diagnostic assistance please?

User avatar
pgbennett
Developer
Posts: 341
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: All remote frontends unable to connect to backend database

Post by pgbennett » Sun Feb 10, 2019 5:40 pm

What is /etc/mysql/conf.d/mythtv.cnf ? Do you actually mean mysql.conf?

For mysql comment the bind-address out, for MariaDB set it as bind-address = :: I don't know what setting it to 0.0.0.0 will do.

Try to connect to the database with mysql:
mysql -u mythtv -p password -h 192.168.1.67 mythconverg

martynbottomley
Newcomer
Posts: 12
Joined: Wed Dec 28, 2016 9:53 pm
Great Britain

Re: All remote frontends unable to connect to backend database

Post by martynbottomley » Sun Feb 10, 2019 7:34 pm

Thanks for your prompt reply

In /etc/mysql/conf.d I have both files mythtv.cnf and mysql.cnf. The only file with the name mysql.conf on my system is in /etc/init

mysql.cnf only has the content:-
[mysql]

mythtv.cnf has the content:-
[mysqld]
bind-address=0.0.0.0
max_connections=100

I have commented out the bind-address in /etc/mysql/my.cnf

Interestingly using your command I could only connect to the mysql database if I omitted the password from the command line

My server frontend and the remote frontends have always had the same system generated password which in this case in 'kkxB13Wn'

If I type the command 'mysql -u mythtv -p -h 192.168.1.67 mythconverg' mysql prompts for the password.

If I type 'kkxB13Wn' I get the response 'ERROR 1045 (28000): Access denied for user 'mythtv'@'192.168.1.67' (using password: YES)'

If I use password 'mythtv' I get the mysql prompt

I tried changing a frontend password to 'mythtv' but the remote frontend will still not connect. The server frontend still connects ok to the backend with password 'kkzB13Wn' configured

I am really confused (not hard) so any additional suggestions would really be appreciated

User avatar
pgbennett
Developer
Posts: 341
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: All remote frontends unable to connect to backend database

Post by pgbennett » Sun Feb 10, 2019 7:56 pm

mysql can have a separate user id and password for each ip address. See what user ids you have this way:
SELECT User, Host FROM mysql.user order by user;

mysql uses % as a wildcard so you can use 'mythtv'@'%' to setup a user id valid from all addresses or 'mythtv'@'192.168.1.1' to setup a user id that only works from 1 ip address. For local use there should be 'mythtv'@'localhost'

update the password this way (insert appropriate values
set password for 'mythtv'@'%' = password('PASSWORD');

Note that the frontend will use the file $HOME/.mythtv/config.xml for finding the database info including he password. That may be a link to /etc somewhere, but I would recommend having a local copy in the $HOME/.mythtv directory.

Note it is possible to override the location of the .mythtv directory using environment variables, but I do not think anybody would do that for normal use.

The .mythtv directory must be writeable and the config.xml file should be writeable, if you have a link to /etc somewhere for the file it may not be writeable by the frontend, and this may cause you problems.

martynbottomley
Newcomer
Posts: 12
Joined: Wed Dec 28, 2016 9:53 pm
Great Britain

Re: All remote frontends unable to connect to backend database

Post by martynbottomley » Mon Feb 11, 2019 1:29 pm

Thanks again for your help

This the output from 'SELECT User, Host FROM mysql.user order by user;' is:-

+------------------+-------------+
| User | Host |
+------------------+-------------+
| debian-sys-maint | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| mythtv | % |
| mythtv | 192.168.1.% |
| root | localhost |
| zmuser | localhost |
+------------------+-------------+

I don't appear to have a 'mythtv'@'localhost' entry

Could you kindly advise the command to add this entry and the command to remove any that should not be there?

I have used the command 'set password for 'mythtv'@'%' = password('PASSWORD');' to 'kkxB13Wn' for both 'mythtv'@'%' and 'mythtv'@'192.168.1.%'

The file $HOME/.mythtv/config.xml was writable but linked to /etc/mythtv/config.xml. I have made a local copy of config.xml in $HOME/.mythtv as recommended

The current situation remains that the server frontend works fine but the remote frontends cannot connect to the server database

I have noticed another problem which may be relevant. My smart TV accesses the Mythtv media server and has worked fine. Now the TV can see the media server and the names of the video recordings, but there is no longer a thumbnail picture next to the name and the video will not play giving a message that the server cannot be accessed and to check the server settings

Any further advice appreciated, or is it time to reload mythtv?

martynbottomley
Newcomer
Posts: 12
Joined: Wed Dec 28, 2016 9:53 pm
Great Britain

Re: All remote frontends unable to connect to backend database

Post by martynbottomley » Mon Feb 11, 2019 2:59 pm

One further point. Although the server frontend will load and I can see the schedule and set programs to record, I have just noticed that the media library/watch recordings option suggest that there are no recordings to play. This is not the case

The frontend suggests that 0% used, 0.00Gb free

martynbottomley
Newcomer
Posts: 12
Joined: Wed Dec 28, 2016 9:53 pm
Great Britain

Re: All remote frontends unable to connect to backend database

Post by martynbottomley » Mon Feb 18, 2019 6:08 pm

Ok so first try to fix was to re-load mythtv but the problem still existed so I resorted to a clean reload of Ubuntu and loading of mythtv from scratch. After a little effort my system is back up and working but I have no idea why it failed in the first place

n7cee
Newcomer
Posts: 1
Joined: Wed Mar 25, 2020 11:00 pm
United States of America

Re: All remote frontends unable to connect to backend database

Post by n7cee » Wed Mar 25, 2020 11:08 pm

I started having the same problem after running 2.29 for maybe a year. None of the frontends could find the database. Ultimately, I upgraded the backend and the frontends to 2.31 and that solved the problem.

Post Reply