Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

ImportCumulusFile.php can't connect to DB

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

ImportCumulusFile.php can't connect to DB

Post by PaulMy »

I have had Toolbox Remote Command run ImportCumulusFile.php to import the realtime.txt and dayfile.txt to my GoDaddy MySQL database and that has worked well. I have recently updated my hosting to cPanel and everything is working again, except the DB import is giving a
12/12/17 - 01:42:07
Importing to table: realtime ...
Processing realtimefile: realtime.txt
Error: Failed to connect to the database server
The Toolbox Remote Command settings have not been changed.

In ImportCumulusFile.php I have only changed $dbhost and $dbpassword from:

Code: Select all

// EDIT THIS NEXT SECTION CAREFULLY
// ----------------------------------------------------------------
// Your security key you will pass in the URL, change this to
// something unique to you
$key = 'a unique key';
// The server host name or number running your MySQL database
// usually 127.0.0.1 or localhost will suffice
$dbhost = 'KomokaWeather.db.5379896.hostedresource.com';
// The username used to log-in to your database server
$dbuser = 'KomokaWeather';
// The password used to log-in to your database server
$dbpassword	= 'my unique password';
// The name of the MySQL database we will store the tables in
$database = 'KomokaWeather';
to:

Code: Select all

// EDIT THIS NEXT SECTION CAREFULLY
// ----------------------------------------------------------------
// Your security key you will pass in the URL, change this to
// something unique to you
$key = 'same unique key';
// The server host name or number running your MySQL database
// usually 127.0.0.1 or localhost will suffice
$dbhost = 'localhost';
// The username used to log-in to your database server
$dbuser = 'KomokaWeather';
// The password used to log-in to your database server
$dbpassword	= 'my unique password for new database';
// The name of the MySQL database we will store the tables in
$database = 'KomokaWeather';
I have talked to GoDaddy and they say to use "localhost" for the new hosting, and have double checked my Username and Password. Have I missed something or are other changes to be made in either Toolbox or ImportCumulusFile.php?

Thanks,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
weatherist34
Posts: 51
Joined: Wed 13 Apr 2016 11:09 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: OSX High Sierra
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by weatherist34 »

Hello Paul

Have a look in phpmyadmin right the very top on the left hand side and you can check the if it is localhost in use .

Select the database you want to use

You can also see the database name sometimes host will insert username_database i.e brıan_weather you may also see localhost:3306 in the host

Discovered recently no one standard for various hosts I’ve always used localhost but recently I have seen many variations when helping others over the last few months .

Brian
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by PaulMy »

Thanks Brian. GoDaddy had mentioned it should be just localhost and I think I have this issue resolved now. I had to do some refresh on my cPanel hosting MySQL DB settings and that seemed to have fixed it, and also change dbconfig as some of my scripts use this file. Imports seem to be current in the various DB tables.

I'll take a little break before I update to PHP 7x which I can now do with cPanel hosting, as I suspect there will be some issues when I do that.

Enjoying again,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
weatherist34
Posts: 51
Joined: Wed 13 Apr 2016 11:09 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: OSX High Sierra
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by weatherist34 »

PaulMy wrote:Thanks Brian. GoDaddy had mentioned it should be just localhost and I think I have this issue resolved now. I had to do some refresh on my cPanel hosting MySQL DB settings and that seemed to have fixed it, and also change dbconfig as some of my scripts use this file. Imports seem to be current in the various DB tables.

I'll take a little break before I update to PHP 7x which I can now do with cPanel hosting, as I suspect there will be some issues when I do that.

Enjoying again,
Paul
Hello Paul

Glad you got that sorted, has for php 7 most common error is non numerical values particularly where scripts calculate where the original values that are non numerical particularly differences and multipliers it easily fixed introducing a number_format or rounding apart prior to making any calculations apart from that nothing major should go wrong.

Brian..
Post Reply