[mythtv-users] Ver 31 frontend cannot connect to the database

Bill Meek keemllib at gmail.com
Tue Nov 24 18:12:20 UTC 2020


On 11/24/20 10:22 AM, Mike Carron wrote:
> 
> On 11/24/20 3:07 AM, Stephen Worthington wrote:
>> On Mon, 23 Nov 2020 19:37:37 -0800, you wrote:
>>
>>> On 11/23/20 6:09 PM, Stephen Worthington wrote:
>>>> On Mon, 23 Nov 2020 16:57:05 -0800, you wrote:
>>>>
>>>>> On 11/23/20 7:13 AM, Bill Meek wrote:
>>>>>
>>>>>      |
>>>>>
>>>>>      snip
>>>>>
>>>>>      |
>>>>>
>>>>>      At least my /etc/mysql/mariadb.conf.d/50-server.cnf, appears to
>>>>>      be one that would be released by a package manager and changes to
>>>>>      it could be overwritten by updates/upgrades.
>>>>>
>>>>>      I'd move the mythtv.cnf file to /etc/mysql/mariadb.conf.d to
>>>>>      prevent future surprises.
>>>>>
>>>>> I've gone over everything and I have to conclude that port 3306 on the
>>>>> backend being closed is the culprit. Since mythfrontend wants to use
>>>>> port 3306 to communicate with the backend I'm not going to get anywhere
>>>>> until port 3306 is opened. Unfortunately I do not know how to do that.
>>>>>
>>>>> How do I open port 3306?
>>>>>
>>>>> mike
>>>> As I said, fix the MariaDB bind-address.  Port 3306 is the port for
>>>> MariaDB, not MythTV.  MariaDB is still binding to 3306 only on
>>>> localhost.  It needs to bind 3306 on all IP addresses.
>>> ma
>>> How do I do that?/
>>>
>>> mike
>> As per my previous post:
>>
>> In your MariaDB settings, the "bind-address=127.0.0.1" is the one
>> being used by MariaDB, instead of the "bind-address=::", because of
>> the order it reads the config files.  The last one read is the one
>> that gets used.  So the simple thing to do is just to comment out the
>> "bind-address=127.0.0.1" line in the
>> /etc/mysql/mariadb.conf.d/50-server.cnf file by putting a # at the
>> start of the line.  Then restart MariaDB:
>>
>> sudo systemctl restart mariadb
>> _______________________________________________
> 
> Did that already.
> 
> I did some more checking and found that "port = 3306" was commented out
> in /etc/mysql/mariadb.conf.d/50-server.cnf. I uncommented it and now I
> no longer see the "ERROR 2002 (HY000): Can't connect to MySQL server on
> '192.168.0.222' (115)" message.

Hard to argue with success, But, the default MySQL/MariaDB  port *is* 3306.
https://mariadb.com/kb/en/connecting-to-mariadb/

I just commented out the one and only active port= line and restarted the
server. It works fine.

This will display the port in use:

SHOW GLOBAL VARIABLES LIKE 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.002 sec)

The same is true for SESSION VARIABLES.

I'd re-comment the line you changed and restart the SQL server.

If it truly does work, then the change shouldn't be made in a
.cnf file that will be overwritten by a package manager. That
could happen at any time, for example 2 years from now when
you upgrade to a new distribution. And will have forgotten
about the change. Changes like this should go in the same
place the bind-address was changed. Just before or after it
would be OK.

But: your computer, your choice.

-- 
Bill


More information about the mythtv-users mailing list