Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

ImportCumulusFile.php can't connect to DB

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

Moderators: daj, TNETWeather

User avatar
PaulMy
Posts: 1675
Joined: Sun Sep 28, 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

Postby PaulMy » Tue Dec 12, 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: 60
Joined: Wed Apr 13, 2016 11:09 am
Weather Station: Oregon WMR300 + Weatherflow
Operating System: OSX High Sierra
Location: Istanbul
Contact:

Re: ImportCumulusFile.php can't connect to DB

Postby weatherist34 » Tue Dec 12, 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: 1675
Joined: Sun Sep 28, 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

Postby PaulMy » Tue Dec 12, 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: 60
Joined: Wed Apr 13, 2016 11:09 am
Weather Station: Oregon WMR300 + Weatherflow
Operating System: OSX High Sierra
Location: Istanbul
Contact:

Re: ImportCumulusFile.php can't connect to DB

Postby weatherist34 » Tue Dec 12, 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..


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 1 guest