Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Error encountered opening MySQL connection

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Error encountered opening MySQL connection

Post by flort »

Hi,

I decided to start utilizing an SQL Database but receive a "Connect timeout expired" error when trying to create the database tables. I assume my server details are all correct otherwise I should get a login error rather than a timeout error. This may be purely a webhosting issue as I use a free webhosting service so don't expect my account would get much priority with connection requests. I have also tried using the ExportToMySQL tool and get the same error.

Does anyone have any suggestions as to what else I might try or is there a way to increase the length of time it tries to connect before timing out?

Regards,
Trevor
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Error encountered opening MySQL connection

Post by mcrossley »

By default MySQL does not allow remote logins for users, you have to specify that (either from a specific host or IP, or * from anywhere) when creating the user account, did you do that?
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Re: Error encountered opening MySQL connection

Post by flort »

Hi Mark,

Thanks for the reply. I was unaware that remote logins were not allowed by default. Upon investigation I have found that the free webhosting plan does not allow configuration of remote SQL.

So what I have done is setup my RPi as a webserver for use within my local network. Everything is working fine and database is updating but I do receive the following error when I view the database through phpMyAdmin -
error.jpg
Have I done something wrong when setting this up? I created the table using the function in Cumulus SQL settings and populated the table using the ExportToMySQL tool.

Regards,
Trevor
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Error encountered opening MySQL connection

Post by mcrossley »

I have found setting up phpMyAdmin a bit of a struggle at times. Sometimes it has setup without any issues at all, the odd time I have spent ages trying to get it working properly.

Can you query the tables OK from the MySQL command line?
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Re: Error encountered opening MySQL connection

Post by flort »

Hi Mark,

Everything seems to be working fine. I even have a couple of web pages talking to the database without any issues. So should I just ignore the errors or try deleting the table and creating it again?

Regards,
Trevor
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Error encountered opening MySQL connection

Post by sfws »

flort wrote: Mon 31 Jan 2022 10:40 pm I do receive the following error when I view the database through phpMyAdmin
That is a standard php error message for php 7.2 upwards which says that use of "count()" in a PHP script is incompatible with the php version you are using. It has nothing to do with database tables, don't delete table and create it again, that is a waste of time as it will not solve anything!

In other words it implies you are using an extremely old version of a phpmyadmin script written using php syntax for php 5.4 to 7.1 era.

Use latest phpmyadmin, i.e. version 5.1.1, (as that works from php 7.2 up to current stable 8.1.x) - see here for a good explanation of how to upgrade and you will be problem free.
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Re: Error encountered opening MySQL connection

Post by flort »

Thanks. Upgraded phpmyadmin as suggested and no more errors.

Regards,
Trevor
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Error encountered opening MySQL connection

Post by mcrossley »

Good spot @sfws. :thumbsup:
Post Reply