Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

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: 1730
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

ImportCumulusFile.php can't connect to DB

Post by PaulMy » Tue 12 Dec 2017 2:54 am

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

weatherist34
Posts: 91
Joined: Wed 13 Apr 2016 11:09 am
Weather Station: Davis Vantage Pro2+Solar
Operating System: OSX High Sierra
Location: Istanbul
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by weatherist34 » Tue 12 Dec 2017 12:11 pm

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: 1730
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by PaulMy » Tue 12 Dec 2017 5:00 pm

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

weatherist34
Posts: 91
Joined: Wed 13 Apr 2016 11:09 am
Weather Station: Davis Vantage Pro2+Solar
Operating System: OSX High Sierra
Location: Istanbul
Contact:

Re: ImportCumulusFile.php can't connect to DB

Post by weatherist34 » Tue 12 Dec 2017 8:30 pm

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