Remote frontend can't access backend MySQL

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

Moderator: Forum Moderators

aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Remote frontend can't access backend MySQL

Post by aartimus »

A couple of weeks ago I upgraded to Mint 17 with a clean install and am continuing struggling to get MythTV and Mythweb working again. The backend and frontend run fine on the new Mint 17 serverm but remote frontends can't connect to the backend.

I traced the problem to MySQL. Specifically, I get the following in the MySQL log when I try to connect:

140903 16:15:34 [Warning] IP address '192.168.0.119' could not be resolved: Name or service not known

where 192.168.0.119 is the IP address of the remote frontend.

I followed the instructions in

http://www.mythtv.org/wiki/MythTV-HO...ltiple_systems

and

http://www.mythtv.org/wiki/MythFrontend

to grant access to the database from remote systems. In spite of this MySQL on the backend stubbornly refuses to accept remote requests.

Ay thoughts?

Thanks
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Remote frontend can't access backend MySQL

Post by wesnewell »

Try adding this file.
wes@mythfe0:~$ cat /etc/mysql/conf.d/xmythtv.cnf
[mysqld]
bind-address = 0.0.0.0
wes@mythfe0:~$
I assume the backend server is 192.168.0.something and you have entered the correct password in the frontend setup.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

Thanks for the suggestion.

Yes, the backend server is at 191.168.0.101 and the password is correct.

Tried the xmythtv.cnf file and it didn't help.

Any other ideas? I'm kind of surporised this has turned out to be such a roadblock. I had no trouble when I did the same thing with the Mint 14 backend.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Remote frontend can't access backend MySQL

Post by wesnewell »

Did you restart mysqld after you added the file? I assume you're running a newer version of mysql.If not, you need to just comment out the skip-networking in /etc/mysql/my.cnf. and this should be the last line of my.cnf.
!includedir /etc/mysql/conf.d/
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
User avatar
rwagner
Developer
Posts: 217
Joined: Thu Feb 06, 2014 11:37 pm
United States of America

Re: Remote frontend can't access backend MySQL

Post by rwagner »

aartimus wrote:the backend server is at 191.168.0.101
Is that a typo?
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

Yea, it's actually 192.168.0.101.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

wesnewell wrote:Did you restart mysqld after you added the file? I assume you're running a newer version of mysql.If not, you need to just comment out the skip-networking in /etc/mysql/my.cnf. and this should be the last line of my.cnf.
!includedir /etc/mysql/conf.d/
Yes, I restarted the daemon.

I'm runnning the latest version of mysql (no skip-netwroking), and my.cnf ends with !includedir /etc/mysql/conf.d/.

The instructions on how to enable network access in the current version are somewhat confusing. my.cnf was originally configured with

bind-address = 127.0.0.1

Based on http://www.mythtv.org/wiki/MythFrontend I changed this to the IP address of the backend

bind-address = 192.168.0.101

Didn't help, though.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

Maybe this will give a clue. I captured this from the command window while trying to connect to the remote backend (192.168.0.101) from a Windows frontend (192.168.0.119):
2014-09-10 13:25:48.240974 I MythCoreContext: Connecting to backend server: localhost:6543 (try 1 of 1)
2014-09-10 13:25:48.250983 E Unable to connect to database!
2014-09-10 13:25:48.250983 E Driver error was [1/1045]:
QMYSQL: Unable to connect
Database error was:
Access denied for user 'mythtv'@'192.168.0.119' (using password: YES)

2014-09-10 13:25:48.254989 E Database not open while trying to load setting: backendserverip6
2014-09-10 13:25:48.258990 E Unable to connect to database!
2014-09-10 13:25:48.258990 E Driver error was [1/1045]:
QMYSQL: Unable to connect
Database error was:
Access denied for user 'mythtv'@'192.168.0.119' (using password: YES)

2014-09-10 13:25:48.262992 E Database not open while trying to load setting: backendserverip
2014-09-10 13:25:48.262992 E No address defined for host: localhost
2014-09-10 13:25:50.262326 E MythSocket(d8f71b8:-1): Failed to connect to (::1:6543) Connection refused
2014-09-10 13:25:50.263323 E 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
One thing the looks wrong in the first line where it seems to be trying to connect to a backend on loclhost. I don't know why it's dong that. I specify the remote backend IP address (192.168.0.101) in setup.

Any ideas?
User avatar
rwagner
Developer
Posts: 217
Joined: Thu Feb 06, 2014 11:37 pm
United States of America

Re: Remote frontend can't access backend MySQL

Post by rwagner »

It looks like you specified your local IP address as the address of your MySQL server.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

rwagner wrote:It looks like you specified your local IP address as the address of your MySQL server.
That's what I thought when I saw it, but I defintely specify the IP of the backend (192.168.0.101) in setup. My suspsion is that there's a config flie somewhere that's not getting updated, but I can't find it.

To add to the confusion I get this in the mysql log on the backend when I try connect a remote frontend

[Warning] IP address '192.168.0.119' could not be resolved: Name or service not known

where 192.168.0.119 is the IP of the frontend.

So the request is getting to the server.

By the way, I also can't connect an OSX frontend. I haven't checked the logs yet, so I don't know if it's the same problem, but the symptons match.
User avatar
rwagner
Developer
Posts: 217
Joined: Thu Feb 06, 2014 11:37 pm
United States of America

Re: Remote frontend can't access backend MySQL

Post by rwagner »

In mythtv-setup, you define the address of the master backend. The first time you run mythtv-setup or mythfrontend, it lets you specify the address of the database, and subsequently stores that in config.xml. It sounds like you have a bad value in your config.xml.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

In mythtv-setup, you define the address of the master backend. The first time you run mythtv-setup or mythfrontend, it lets you specify the address of the database, and subsequently stores that in config.xml. It sounds like you have a bad value in your config.xml.
That's what I thought at first. But here's my config.xml file located in .mythtv in my home directory:
<Configuration>
<LocalHostName>my-unique-identifier-goes-here</LocalHostName>
<Database>
<PingHost>1</PingHost>
<Host>192.168.0.101</Host>
<UserName>mythtv</UserName>
<Password>********</Password>
<DatabaseName>mythconverg</DatabaseName>
<Port>3306</Port>
</Database>
<WakeOnLAN>
<Enabled>0</Enabled>
<SQLReconnectWaitTime>0</SQLReconnectWaitTime>
<SQLConnectRetry>5</SQLConnectRetry>
<Command>echo 'WOLsqlServerCommand not set'</Command>
</WakeOnLAN>
</Configuration>
It has the correct backend IP address (192.168.0.101). It there another possible config.xml file that might override this one?
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Remote frontend can't access backend MySQL

Post by wesnewell »

You can't bind your local ip in my.cnf if you want access from other ip's, unless you put another bind-address later that will open it up. That's why I use my own xmythtv.cnf file that binds to 0.0.0.0, which opens it to all addresses.I made it xmythtv.cnf, because every fricking update over wrote the mythtv.cnf and commented out the 0.0.0.0 bind address I had in it. Updates don't mess with mine, and it's always the last config file read because of the name that starts with x. I'm not even sure what my orig my.cny use for the bind address......
wes@mythfe0:~$ cat /etc/mysql/my.cnf|grep bind-address
bind-address = 127.0.0.1
wes@mythfe0:~$
wes@mythfe0:~$ cat /etc/mysql/conf.d/xmythtv.cnf|grep bind-address
bind-address = 0.0.0.0
wes@mythfe0:~$
I've read you can just remove or comment out the bind-address and it opens all ports, but it may get over written on upgrades. If you still can't connect to mysql after binding to 0.0.0.0, then you have another problem somewhere.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
aartimus
Junior
Posts: 21
Joined: Tue May 27, 2014 6:01 am
United States of America

Re: Remote frontend can't access backend MySQL

Post by aartimus »

Tried bind-address = 0.0.0.0 in conf.d with bind-address in my.cnf set to its original value of 127.0.0.1. Got the same result. The frontend still can't contact the server.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: Remote frontend can't access backend MySQL

Post by wesnewell »

Did you try commenting out the bind-address directive? Also just noticed your ipv6 address. It didn't work right with my right ipv6 address either. had to change it in mythtv-setup to ::1 Do you have a firewall set? That's all I can think of at the moment.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
Post Reply