Frontend Can't Connect To Database
Frontend Can't Connect To Database
With the hot weather here in CA my router took a dirt nap and I'm re-configuring my network with an unused wireless router. My database and mythtv-backend are on two different hosts. Both frontends can see both servers just fine and vice-versa. I have tried setting config.xml on the frontends using a hostname (which resolves from the command line) and IP address. I have checked mysql on the database server and mythtv-backend on the myth server. This was all working before the old router died.
Does anyone have any ideas?
Does anyone have any ideas?
Re: Frontend Can't Connect To Database
Remove mythtv from the picture and try this (if it doesn't work, then the frontend won't):
mysql --user=mythtv --host=<your DB hostname here> --password mythconverg
The user/host/password/DB name are from the config.xml used when starting the FE.
mysql --user=mythtv --host=<your DB hostname here> --password mythconverg
The user/host/password/DB name are from the config.xml used when starting the FE.
Re: Frontend Can't Connect To Database
Well now I'm confused. From the command line
Works fine. I am able to use mythconverg and run a query. But updating /home/mythtv/.mythtv/config.xml to
And the frontend still won't connect. I went into the setup screen to confirm settings.
Any ideas?
Code: Select all
#mysql -u mythtv -h amber -p
Code: Select all
<Configuration>
<Database>
<PingHost>1</PingHost>
<Host>amber</Host>
<UserName>mythtv</UserName>
<Password>mythconverg</Password>
<DatabaseName>mythconverg</DatabaseName>
<Port>3306</Port>
Any ideas?
-
- Senior
- Posts: 265
- Joined: Sun Jun 15, 2014 1:08 am
Re: Frontend Can't Connect To Database
amber is likely resolved in local hosts file..
But AFAIK for config.xml file..
Host can only be localhost or an IP address .
Can not use a DNS resolvable name.
But AFAIK for config.xml file..
Host can only be localhost or an IP address .
Can not use a DNS resolvable name.
Re: Frontend Can't Connect To Database
I use host names (known to /etc/hosts) OK.
@kbocek, let's see the FE log from startup to failure. pastebin.com is fine
as long as no password is required.
@kbocek, let's see the FE log from startup to failure. pastebin.com is fine
as long as no password is required.
-
- Senior
- Posts: 265
- Joined: Sun Jun 15, 2014 1:08 am
Re: Frontend Can't Connect To Database
Did not know a name would work there. The wiki does not agree??
But he said he's using separate PC for DB & MFE so he needs the same hosts file content in both files or needs a DNS or resolver.
But he said he's using separate PC for DB & MFE so he needs the same hosts file content in both files or needs a DNS or resolver.
Re: Frontend Can't Connect To Database
@blm-ubunet, please mention the Wiki and I'll fix it.
Agreed, amber should resolve to the same IP everywhere. We'll see where the failure is in the log.
Agreed, amber should resolve to the same IP everywhere. We'll see where the failure is in the log.
Re: Frontend Can't Connect To Database
This seems to be a name resolution issue. With my now deceased router I was doing local DNS and had a pseudo-domain ".pvt" for all my LAN addresses. I've had to fall back on a wireless router to get the house net access. But the DNS server went away and along with it ".pvt". I've gone through all the hosts and setup static name resolution through /etc/hosts.
The two server hosts are amber (mysql) and myth (mythtv-backend and mythweb). Mythweb is now saying
That is the correct address for myth. Checking the status of mythbackend:
Mythbackend runs for a few minutes but then fails with
Does that mean it can't contact the database? If so it sounds like a permissions error on the database.
The two server hosts are amber (mysql) and myth (mythtv-backend and mythweb). Mythweb is now saying
Code: Select all
Unable to connect to the master backend at 10.0.2.2:6543.
Is it running?
Code: Select all
$ sudo systemctl status mythtv-backend
● mythtv-backend.service - MythTV Backend
Loaded: loaded (/lib/systemd/system/mythtv-backend.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-09-08 10:21:36 PDT; 24s ago
Docs: https://www.mythtv.org/wiki/Mythbackend
Main PID: 3093 (mythbackend)
Tasks: 6 (limit: 2299)
CGroup: /system.slice/mythtv-backend.service
└─3093 /usr/bin/mythbackend --quiet --syslog local7
Code: Select all
Sep 8 10:22:22 myth mythbackend: mythbackend[3093]: I CoreContext mythcontext.cpp:852 (TestDBconnection) Start up testing connections. DB amber.pvt, BE , attempt 10, status dbAwake
Sep 8 10:22:27 myth mythbackend: mythbackend[3093]: I CoreContext mythcontext.cpp:971 (TestDBconnection) Start up failure. host amber.pvt, status dbAwakeFail
Sep 8 10:22:28 myth mythbackend: mythbackend[3093]: C CoreContext main.cpp:132 (main) Failed to init MythContext.
Re: Frontend Can't Connect To Database
Finally found it! /etc/mythtv/config.xml on myth still had "amber.pvt". Changed that to "amber" and corrected the password and it looks like all is good! Yay! What a PITA.
Thank you all for your suggestions. Even though you didn't know my exact solution, all your suggestions helped guide my debugging process.
Thank you all for your suggestions. Even though you didn't know my exact solution, all your suggestions helped guide my debugging process.
Re: Frontend Can't Connect To Database
Now that I think about it I think I could have just added all my ".pvt" host names to the hosts file and everything would have just worked. Ugh. Hind-sight is 20-20.