Linux Cannot connect to MYSQL
#1
I recently had a problem where all my addons caused Kodi to crash. Everything else was working correctly. I was still running v15 so I upgraded to v17 (17.1 Git:20170320-nogitfound). This still didnt fix the problem so I did a reinstall of Kodi 17 and renamed the .kodi directory thinking there was something in there causing the addon problems.

This fixed the problem with the addons which are now working again but now Kodi cannot connect to the MySQL server containing my library which is installed on the same box as kodi.

Code:
ERROR: Unable to open database: MyVideos107 [2003](Can't connect to MySQL server on '192.168.0.6' (101))

I have copied the old advancedsettings.xml file from the previous install which is being picked up as seen in the log file:

Code:
13:30:09.911 T:140686524279168  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <useddsfanart>true</useddsfanart>
                                              <cputempcommand>cputemp</cputempcommand>
                                              <gputempcommand>gputemp</gputempcommand>
                                              <samba>
                                                <clienttimeout>30</clienttimeout>
                                              </samba>
                                              <network>
                                                <disableipv6>true</disableipv6>
                                              </network>
                                              <videodatabase>
                                                <type>mysql</type>
                                                <host>192.168.0.6</host>
                                                <port>3306</port>
                                                <user>root</user>
                                                <pass>*****</pass>
                                              </videodatabase>
                                            </advancedsettings>

I have tried changing the IP to localhost, 127.0.0.1 and it makes no difference.
I can connect and login to the MySQL server using ssh.

Any suggestions?

Cheers
BM
Reply
#2
(2017-03-21, 14:52)BM007 Wrote: I can connect and login to the MySQL server using ssh.

How do you console login to mysql? Something like this:
Code:
mysql -uroot -hlocalhost -p <video_db>

Or, can you do that? BTW, using root is a bad idea.

-S
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q250c | KEF Q150 | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#3
(2017-03-21, 19:23)MacUsers Wrote: How do you console login to mysql? Something like this:
Code:
mysql -uroot -hlocalhost -p <video_db>

Code:
mysql -u root -p
(2017-03-21, 19:23)MacUsers Wrote: BTW, using root is a bad idea.
I know, I dont usually just while trying to get this working
Reply
#4
Try this first:
Code:
mysql -uroot -hlocalhost -p<pass_word> <video_db>

as far as I understand: if you cannot do that, Kodi cannot either.

-S
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q250c | KEF Q150 | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply
#5
I have that problem with v17 sometimes, like it seems it loads Kodi too quick before the network interface is up so it won't connect to the database. Usually restarting it works or doing a "sudo service lightdm restart" works. Mine is on a remote server and not the local one so it seems strange that it can't connect. Are you running Kodi from a desktop environment or are you booting straight into Kodi with the MySQL db service starting at boot?
Reply
#6
(2017-03-22, 01:15)MacUsers Wrote: Try this first:
Code:
mysql -uroot -hlocalhost -p<pass_word> <video_db>

as far as I understand: if you cannot do that, Kodi cannot either.

-S
I cant do that but I can do
Code:
mysql -u root -h localhost -p MyVideos107

(2017-03-22, 04:32)Daemaz Wrote: I have that problem with v17 sometimes, like it seems it loads Kodi too quick before the network interface is up so it won't connect to the database. Usually restarting it works or doing a "sudo service lightdm restart" works. Mine is on a remote server and not the local one so it seems strange that it can't connect. Are you running Kodi from a desktop environment or are you booting straight into Kodi with the MySQL db service starting at boot?

Code:
sudo service lightdm restart
Allowed kodi connect so thanks for the tip. I boot straight into Kodi so it seems I need a way to get kodi to wait a bit so MySQL can finish loading
Reply
#7
(2017-03-22, 09:26)BM007 Wrote: I boot straight into Kodi so it seems I need a way to get kodi to wait a bit so MySQL can finish loading
Isn't your mySQL and Kodi on the same server? I'd say it's a bit strange in this case. try:
Code:
systemctl restart kodi

and after that if you see everything is working fine, then it's an odd timing issue.

With OpenELEC and LibreELEC, there is check box in the settings for this particular purpose.
There is also an add-on available for that or use wakeonlan.xml

-S
MINIX NEO U22-XJ | Denon AVC-X3800H | KEF Q750 | KEF Q250c | KEF Q150 | KEF Q50a | KEF Kube 10 MIE | LG OLED65G16LA | CoreELEC
Reply

Logout Mark Read Team Forum Stats Members Help
Cannot connect to MYSQL0