Author Topic: Change connection timeout setting for MySQL Service  (Read 565 times)

0 Members and 1 Guest are viewing this topic.

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Change connection timeout setting for MySQL Service
« on: April 05, 2019, 02:01:23 PM »
Getting this error when configuring a new MySQL upload site:

Quote
Meteobridge settings successfully reloaded
Error: Timed out to connect to MYSQL database: 6 seconds

Is it possible to change that timeout setting for Meteobridge?

MB NanoSD
MB v 3.8

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Change connection timeout setting for MySQL Service
« Reply #1 on: April 05, 2019, 02:19:36 PM »
You likely have some other issue going on. 6 seconds is a very long time already. Transaction timeouts are handled by the SQL server not the Meteobridge regardless. That 6 second timeout is probably a limit set in the Meteobridge for it to finally give up when something is wrong elsewhere. Which is why I said that this is already pretty high.....so having the Meteobridge wait longer isn't going to help. The SQL server has some transaction timeouts that can be set (overridden) but usually the default settings are sufficient except in extreme load environments. So this is not something you need to tweak. The error you see about a timeout is not the most informative ...but such are things a lot of times with these types of systems. You need to find the root cause. What I'm saying is that you aren't having a delay in response time issue even though it may appear so.

Have you ever successfully connected to your SQL server or is this a new setup?
Also did you give the username and IP (host name - where I use %) used in the SQL connection of the Meteobridge that you have given the proper privileges over at the SQL server?

Some details of the type of SQL and version that you are running might help too.

Do you know your SQL server socket port for your SQL server? Is it 3306 or 3307 ..etc?
« Last Edit: April 05, 2019, 03:09:46 PM by galfert »
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Re: Change connection timeout setting for MySQL Service
« Reply #2 on: April 05, 2019, 03:05:52 PM »
You likely have some other issue going on. 6 seconds is a very long time already. Transaction timeouts are handled by the SQL server not the Meteobridge regardless. That 6 second timeout is probably a limit set in the Meteobridge for it to finally give up when something is wrong elsewhere. Which is why I said that this is already pretty high.....so having the Meteobridge wait longer isn't going to help. The SQL server has some transaction timeouts that can be set (overridden) but usually the default settings are sufficient except in extreme load environments. So this is not something you need to tweak. The error you see about a timeout is not the most informative ...but such are things a lot of times with these types of systems. You need to find the root cause. What I'm saying is that you aren't having a delay in response time issue even though it may appear so.

Have you ever successfully connected to your SQL server or is this a new setup?
Also did you give the username and IP used in the SQL connection of the Meteobridge that you are using Global privileges over at the SQL server?

Some details of the type of SQL and version that you are running might help too.

Do you know your SQL server socket port for your SQL server? Is it 3306 or 3307 ..etc?

Shared Linux hosting at Bluehost
CentOS I think
PHP   7.0.33
MySQL   5.6.41-84.1
Port 3306 is what I have often used with DB's there.
And I have a fairly high bandwith with Comcast.

I haven't set up a new remote upload DB there in a while and I am not confident they allow it now.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Change connection timeout setting for MySQL Service
« Reply #3 on: April 05, 2019, 03:19:26 PM »
Oh it isn't local. A remote remote connection needs to be enabled.

https://my.bluehost.com/hosting/help/89

« Last Edit: April 05, 2019, 03:21:10 PM by galfert »
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Re: Change connection timeout setting for MySQL Service
« Reply #4 on: April 05, 2019, 04:03:50 PM »
Oh it isn't local. A remote remote connection needs to be enabled.

https://my.bluehost.com/hosting/help/89
I knew about the remote setup and went in and updated my Class C.

Back to MB, and re-checked my DB & username/pwd setup. The user has been granted all privileges on the DB.

Result:
Error: Failed to connect to MYSQL database: Access denied for user 'myDBUsername'@'c-73-107-42-111.hsd1.fl.comcast.net' (using password: YES)

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: Change connection timeout setting for MySQL Service
« Reply #5 on: April 05, 2019, 08:57:43 PM »
This is good. Progress. You are getting to the SQL server and now you are getting better error messages.

Log into SQL server as root and do this:

Go to MySQL server's bin folder or add it to PATH
Login to root by mysql -uroot -proot (or whatever the root password is.)
On success you will get mysql>
Provide grant access all for that user:

Code: [Select]
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option;

where:
IP is the IP address to be granted access
USERNAME is the user you use to connect
PASSWORD is that user's password

To allow access from any IP address enter in % instead of an IP address.

lastly do this:
Code: [Select]
FLUSH PRIVILEGES;

Or restart MySQL server
« Last Edit: April 05, 2019, 09:03:44 PM by galfert »
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Re: Change connection timeout setting for MySQL Service
« Reply #6 on: April 12, 2019, 02:10:03 PM »
This is good. Progress. You are getting to the SQL server and now you are getting better error messages.

Log into SQL server as root and do this:

Go to MySQL server's bin folder or add it to PATH
Login to root by mysql -uroot -proot (or whatever the root password is.)
On success you will get mysql>
Provide grant access all for that user:

Code: [Select]
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option;

where:
IP is the IP address to be granted access
USERNAME is the user you use to connect
PASSWORD is that user's password

To allow access from any IP address enter in % instead of an IP address.

lastly do this:
Code: [Select]
FLUSH PRIVILEGES;

Or restart MySQL server

Well, as I am on a shared hosting linux server I cannot get root or sudo, even though I can ssh into the server; and I think Bluehost keeps the MySQL service on a separate box. Might motivate me to move to a different service...

Many thanks,

 

anything