Raspberry Pi 2 cannot login to MySQL

If you look at the whole thread you will see that I am not speaking about Microsoft SQL Server. I am using MySQL for OSMC and Kodi.

I know you are running MySQL on a 2K12 server , take a look and read some of the results.

One of the purposes of forums is for people to ask questions of those that may have seen the same or similar issues and provide answers. Telling those questioners to search google or to supply google results lists is not helpful. I already know how to use search engines. I wanted to get an answer from those who might know the answers already. Thank you for your help with google though. It might be fruitful. If you do have answers that I seek then you can provide them and I will do what I can with your answers.

Do you have “wait for network” checked in MyOSMC>Networking ???

That is a very good question. I will have to check on that. I did not do anything manually with that flag at any point but maybe it is not set correctly. What should the value be set to so that I can put it in that mode when I check tonight?

I am more than happy to support the OSMC users with OSMC.

I am sorry for directing you to the documentation for other software like “how to telnet to sql” and “how to check sql logs”, which are questions you have already asked.

Dilligaf,

Wait for network is turned off. Should I turn it on?

Also, the damnedest thing. I turned on the system tonight that has the Pi 2 that was not connecting to MySQL the other night and it is all connected this time. All without changing anything to any of the devices or anything on my network or MySQL. I don’t understand. Do you?

Yes, you should definetly switch this ON if you use an external MySQL server.
Again your problem might be a timing issue so wait for network might be the solution and that could also explain why it sometimes work.

Did you use the MyOSMC settings in the GUI to set the MySQL information? Or did you simply edit the advancedsettings.xml file directly?

I edited the advancedsettings.xml file directly as directed to do such in the help section that I found on how to configure a shared system. The problem went away by “itself” but I think the “Wait for network” setting should be turned on. The build log in the OSMC Blog indicated that a change was made to add that setting especially for MySQL. So I have turned on that setting on all of my OSMC devices now. I will monitor this and see what happens but it certainly seems fitting to have that turned on.Thanks to Dillagaf for mentioning it.

When the MySQL details are entered using the MyOSMC GUI, WaitForNetwork is turned on automatically.

I have just written a commit that will have MyOSMC check for MySQL details (‘host’, ‘port’, ‘user’, ‘pass’) in the advancedsettings.xml file on start-up and automatically turn on WaitForNetwork if they are present. This should mean that the problem would only occur once, and a reboot would automatically fix it.

If it passes testing we should see it in the next update.

1 Like

Perfect. As a software developer for 30+ years I appreciate the quick and simple resolution. I thank all of you for your hard work. Cheers.

Could you not do an automatic reboot if the WaitForNetwork was automatically turned on in that situation so that the user would not have to see the issue?

Forcing a reboot would be a little heavy-handed, and I wouldn’t want to tread on the toes of any other functions that were occurring at the same time.

But adding in a modal notification of the issue should be doable. The user can then decide to reboot immediately if they wish.

Ok. I agree in that case. A message box indicating that a reboot is recommended and possibly a reason why and what might happen if they don’t reboot. That is a good idea too. I look forward to this. I was happy to uncover this issue.

OK, the dialog will say:

OSMC has detected MySQL details in your advancedsettings file and turned on “Waiting for Network” at boot. MySQL connection issues may be resolved on reboot

This is after checking whether WaitForNetwork is not already active, of course.

It will allow the user to choose “OK” or “Undo” to revert the change. It will timeout after 10 seconds rather than being permanently modal, so it wont conflict with any other messages that are being posted (perhaps over the top of this one).