Solved Mysql problems since changing modem/router
#1
Hi.

I hope someone here can give me what I suspect is an easy fix to my problem below:

I recently changed modems & now everything on my network has been assigned new IPs. 
My Kodi devices then started to freeze on the splash screen during startup & after eventually un-freezing, they would refuse to scan media to the appropriate libraries.
After a frustrating few hours, I worked out that it was my Mysql database that was causing the problems.
With the Mysql database setting removed from the advancedsettings.xml, Kodi would startup like normal, scan & play files without issues.
I decided to create a new Mysql database but as soon as I modify the advancedsettings.xml with the Mysql database parameters (as per these instructions: https://tinyurl.com/2h4hd5ra), the problems would start over again.
I am trying to configure all this via my main Kodi device (Windows PC) & the Mysql database is on a Synology NAS.

Here is the log file

I'm guessing that I'm missing something simple but I'm buggered if I can work it out. I never had these issues last time I set up my Mysql database.

Thanks in advance.
Reply
#2
My first thought here is "Is that IP address correct?".  There are errors with your path substitution as well as the db connection (error 10061 is connection refused) although that could also be a permissions issue.  If you are not using a static IP for your NAS I'd strongly suggest setting one, just so the address never changes.

It could also be that MySQL is not listening on that IP address (again a good reason for a static IP) and only on the loopback address which would generate that error.  So, ensure the IP address of the NAS is static, make sure that MySQL is listening on that address, double check that the port is correct (it's the default port but can be changed in the MySQL settings) and that there is no firewall blocking that port then try again.
Learning Linux the hard way !!
Reply
#3
(2021-03-18, 10:35)black_eagle Wrote: My first thought here is "Is that IP address correct?".  There are errors with your path substitution as well as the db connection (error 10061 is connection refused) although that could also be a permissions issue.  If you are not using a static IP for your NAS I'd strongly suggest setting one, just so the address never changes.

It could also be that MySQL is not listening on that IP address (again a good reason for a static IP) and only on the loopback address which would generate that error.  So, ensure the IP address of the NAS is static, make sure that MySQL is listening on that address, double check that the port is correct (it's the default port but can be changed in the MySQL settings) and that there is no firewall blocking that port then try again.

Thanks for the response  Smile

Nas IP is static & correct.
Nas Firewall is disabled.
Port is correct.

How do I check/confirm that Mysql is listening on the correct address?
Reply
#4
It's in the configuration file (my.cnf).  No idea unfortunately how you can check that from phpMyAdmin although there will likely be a page in there somewhere that tells you - I haven't used that for years though!  It's also worth checking that the kodi user is allowed to login from any host (signified by '%') as that could also cause a connection refused error.  IE, user and password are correct but login from IP xxx.xxx.xxx.xxx for that user is not allowed.
Learning Linux the hard way !!
Reply
#5
Thanks again, black-eagle.
Any host (%) is allowed connection.

This is quite frustrating as literally, the only thing to have changed on the network is the modem (& in turn, IPs). All other devices & settings were untouched. I really expected it to be a simple matter of adding new IP NFS permissions on the NAS & creating a new MySQL database/modifying advancedsettings.xml
Reply
#6
Well, in that case, I'd have to suspect some sort of firewall/port blocking on the new router.  If it worked previously with all the same settings and devices and the only difference is the router then logically, that is causing the issue.  Is it possible for you to swap back to the original temporarily and see if the issue goes away?  At least that would confirm one way or another whether the new router is indeed the issue.
Learning Linux the hard way !!
Reply
#7
Hi,

if you can ssh into your nas you can try

netstat -tln

you should see a line like this

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

if its there mysql listenws on port 3306
Reply
#8
Sad 
(2021-03-18, 11:46)black_eagle Wrote: Is it possible for you to swap back to the original temporarily and see if the issue goes away?  At least that would confirm one way or another whether the new router is indeed the issue.

Issue still persists  Sad

I'm ready to give up. This has taken up too much of my time as it is.
Is there an alternative to MySQL & TRAKT?
Reply
#9
(2021-03-18, 11:58)ramis52 Wrote: if you can ssh into your nas you can try
No luck with SSH. Putty prompts for a user (admin) but then won't let me enter a password when prompted.
Reply
#10
(2021-03-18, 21:21)76pfred Wrote: I'm ready to give up. This has taken up too much of my time as it is.

I can imagine.
 
(2021-03-18, 21:23)76pfred Wrote: No luck with SSH. Putty prompts for a user (admin) but then won't let me enter a password when prompted.
Try connecting to MySQL using putty with a telnet session using the IP and port from your as.xml settings.  If it connects you should see a version string from the server when it prompts for a password.  It will likely disconnect quite quickly so you might want to set putty to not close the window on exit.

This is what I get with a telnet connection to mariaDB.

sql:
telnet 192.168.1.125 3306
Trying 192.168.1.125...
Connected to 192.168.1.125.
Escape character is '^]'.
j
5.5.5-10.0.38-MariaDB-0ubuntu0.16.04.1�^y;Z6=o7bi-?�iR>}~!%7$N?-mysql_native_passwordConnection closed by foreign host.

It will pass your windows username as the user unless you change it in putty's settings.  At least that would confirm that the server is running and listening for connections.
Learning Linux the hard way !!
Reply
#11
When I try a telnet connection using NAS IP & port 3306 I get: Network error. Connection refused.
Reply
#12
(2021-03-18, 22:42)76pfred Wrote: When I try a telnet connection using NAS IP & port 3306 I get: Network error. Connection refused.

Port 3306 is the default MySQL server port, while Telnet usually uses port 22. Those two do not mix.
Is Telnet/SSH enabled on the NAS?
Reply
#13
(2021-03-18, 23:38)Klojum Wrote:
(2021-03-18, 22:42)76pfred Wrote: When I try a telnet connection using NAS IP & port 3306 I get: Network error. Connection refused.

Port 3306 is the default MySQL server port, while Telnet usually uses port 22. Those two do not mix.
Is Telnet/SSH enabled on the NAS?
OK, thanks. Telnet was not enabled but is now. The port was 44.

If I telnet using port 44 I get: "SSH-2.0-OpenSSH_7.4" but nothing else
If I telnet using port 22 I get prompted to login as user (admin) & enter password but I cannot type this.
If I telnet using the default Putty port 23 I get nothing.
Reply
#14
I suggest you download WakeMeOnLan and start a scan - This will show you all the IP hardware installed in your LAN - Hopefully you can SEE your MySQL IP.
Reply
#15
(2021-03-18, 23:57)vskatusa Wrote: I suggest you download WakeMeOnLan and start a scan - This will show you all the IP hardware installed in your LAN - Hopefully you can SEE your MySQL IP.

Cheers.
Yep, NAS IP (MySQL?) is visible.
Reply

Logout Mark Read Team Forum Stats Members Help
Mysql problems since changing modem/router0