[SOLVED] Unable to connect to database error, FreeBSD 12.1

For discussion of topics specific to MythTV on FreeBSD
Post Reply
jjthomas
Junior
Posts: 57
Joined: Sun Jul 19, 2015 11:53 am
United States of America

[SOLVED] Unable to connect to database error, FreeBSD 12.1

Post by jjthomas » Sun Aug 02, 2020 5:53 pm

uname -a FreeBSD anthem.027esc.net 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64

MythTV Version: 30.0_5,1

/usr/local/etc/mysql/my.cnf:
bind-address = 0.0.0.0

Error:

Code: Select all

Start up testing connections. DB localhost, BE 172.24.153.2, attempt 1, status beAwake, Delay: 2000
2020-08-02 10:30:31.441941 I  Start up failure. host 127.0.0.1, status beAwakeFail
2020-08-02 10:30:31.446632 I  MythCoreContext::ConnectCommandSocket(): Connecting to backend server: 172.24.153.2:6543 (try 1 of 1)
2020-08-02 10:30:31.450264 I  MythCoreContext::CheckProtoVersion(): Using protocol version 91 BuzzOff
2020-08-02 10:30:54.650015 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2020-08-02 10:30:56.757036 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 1, status beAwake, Delay: 2000
2020-08-02 10:31:02.003630 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 2, status beAwake, Delay: 2000
2020-08-02 10:31:07.275506 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 3, status beAwake, Delay: 2000
2020-08-02 10:31:12.485706 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 4, status beAwake, Delay: 2000
2020-08-02 10:31:17.768387 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 5, status beAwake, Delay: 2000
2020-08-02 10:31:23.048580 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 6, status beAwake, Delay: 2000
2020-08-02 10:31:28.367314 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 7, status beAwake, Delay: 2000
2020-08-02 10:31:33.651379 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 8, status beAwake, Delay: 2000
2020-08-02 10:31:38.864284 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 9, status beAwake, Delay: 2000
2020-08-02 10:31:44.047013 I  Start up testing connections. DB localhost, BE 172.24.153.2, attempt 10, status beAwake, Delay: 2000
2020-08-02 10:31:49.272931 I  Start up failure. host localhost, status beAwakeFail
2020-08-02 10:31:55.058889 A  Cannot connect to backend
2020-08-02 10:31:55.058907 E  Failed to init MythContext, exiting.
2020-08-02 10:31:55.066321 I  OpenGL2: Deleting OpenGL Resources
2020-08-02 10:31:55.066999 I  OpenGL: Deleting OpenGL Resources
2020-08-02 10:31:55.077693 I  Waiting for threads to exit.
my config.xml

Code: Select all

<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>localhost</Host>
    <UserName>mythtv</UserName>
    <Password>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>
  <UPnP>
    <UDN>
      <MediaRenderer>822d2ba7-6858-4d8f-8490-8df04b6f7f8c</MediaRenderer>
    </UDN>
  </UPnP>
</Configuration>
If I connect via my user I get:

Code: Select all

jjthomas@anthem:~ % mysql -h '172.24.153.2' -u mythtv -pPassword mythconverg
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.7.30-log Source distribution

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mythtv@172.24.153.2 [mythconverg]> quit
Bye
jjthomas@anthem:~ % 
Why won't MythTV connect to the database when I run mythfrontend?

TIA

-JJ
Last edited by jjthomas on Mon Aug 03, 2020 12:48 am, edited 1 time in total.

User avatar
bill6502
Developer
Posts: 1724
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Unable to connect to database error, FreeBSD 12.1

Post by bill6502 » Sun Aug 02, 2020 8:27 pm

Hi,

I'm guessing that the log snippet above is mythfrontend.log or command line output.
It says the FE was able to connect to the DB using localhost to locate the DB server.

And it was successful. Then it retrieved the IP of the BE (BE 172.24.153.2 in the log).
That's what failed. See if mythbackend was running.

jjthomas
Junior
Posts: 57
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: Unable to connect to database error, FreeBSD 12.1

Post by jjthomas » Mon Aug 03, 2020 12:47 am

Aw crap! I had my primary address set to 127.0.0.1. I changed the address to 172.24.153.2. It now works. Thank you.

-JJ

Post Reply