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

Unable to create SQL dayfile table

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
forestedge
Posts: 45
Joined: Sun Jul 29, 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Unable to create SQL dayfile table

Postby forestedge » Mon Mar 12, 2018 4:24 pm

I have been unable to create the dayfile SQL database running ImportCumulusFile.php and get the following error.

[12-Mar-2018 16:11:01 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function apache_setenv() in /home/tottonwe/public_html/ImportCumulusFile.php:193
Stack trace:
#0 {main}
thrown in /home/tottonwe/public_html/ImportCumulusFile.php on line 193


Line 193 is
@apache_setenv('no-gzip', 1);
and should not be edited according to the readme.
Server is running php 5.6.34 and MySQL 5.6.38

I have also tried creating database from within MX but get an error on saving settings
error[objectOBJECT]

Any help appreciated please.

User avatar
mcrossley
Posts: 5192
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Unable to create SQL dayfile table

Postby mcrossley » Mon Mar 12, 2018 5:11 pm

Yep, I am testing a version of the script that fixes that error. However, if you are running MX, then it can create the tables for you anyway in the MySQL settings. The only thing you need the script for with MX is importing historic data.

Try deleting line 193 from the script, it may just fix it, though there may be an adjacent line that needs to go as well - can't recall without digging out the scripts.

forestedge
Posts: 45
Joined: Sun Jul 29, 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Re: Unable to create SQL dayfile table

Postby forestedge » Fri Mar 16, 2018 2:09 pm

Thanks, deleting line 193 sorted that out but now getting error message
Running from web server
Script start: 16/03/18 - 12:43:33
Importing file: /Data/dayfile.txt, To table: dayfile ...
Error: Failed to open file: '/Data/dayfile.txt'
Script complete: 16/03/18 - 12:43:33
Execution time: 0 secs


Still getting the error[objectOBJECT] when trying to create table from within MX as well.

I could try importing direct into MySQL but there are a range of formats for the db format with MyISAM as default.
Others include CSV and InnoDB.

User avatar
mcrossley
Posts: 5192
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Unable to create SQL dayfile table

Postby mcrossley » Fri Mar 16, 2018 2:21 pm

looks like you have given an absolute path to your day file, but from the root it looks like it should be something like...

/home/tottonwe/public_html/Data/dayfile.txt

and remember it is case sensitive

forestedge
Posts: 45
Joined: Sun Jul 29, 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Re: Unable to create SQL dayfile table

Postby forestedge » Fri Mar 16, 2018 5:04 pm

The same error message appears with the full path and other variations!

The error log is showing
[16-Mar-2018 16:49:18 Europe/London] PHP Warning: mysqli::__construct(): (28000/1045): Access denied for user 'username'@'localhost' (using password: YES) in /home/tottonwe/public_html/ImportCumulusFile.php on line 252

Line 252 is
$mysqli = new mysqli($dbhost, $dbuser, $dbpassword, $database);


Seems odd that settings cannot be saved from within MX either using:
localhost
Port 21
User: tottonwe_name
Password:XXXX
Database:tottonwe_dayfile

sfws
Posts: 431
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Unable to create SQL dayfile table

Postby sfws » Fri Mar 16, 2018 6:28 pm

I don't use MX, so cannot advise re that aspect.
My database has a different schema to that Mark uses, so I cannot help with anything specifically relating to that aspect either.
But maybe something I say below might still help you?
forestedge wrote:Database:tottonwe_dayfile

Presumably that is a database name rather than the name of a table within the database?
Does this database exist yet? If the database exists, but not tables within it, maybe you can use a tool like "phpMyAdmin" to look at it. How you get to that tool (if you have it) depends on your server set up, and so I can't tell you exactly what to type in. That can sometimes confirm that user and password for access are correct. It might also help to diagnose any permissions related issue?
If the database does not exist, "phpmyadmin" can create a database, and could create a test table for you (you might be able to copy structure from "ImportCumulusFile.php").
forestedge wrote:I could try importing direct into MySQL but there are a range of formats for the db format with MyISAM as default.
Others include CSV and InnoDB.

I don't know whether it matters, but I'm using "InnoDB" for all my database accesses, and the PHP I use has some resemblance with that "ImportCumulusFile.php" uses, and I guess therefore matches http://sandaysoft.com/forum/viewtopic.php?f=27&t=12908&start=15#p107639
forestedge wrote:The same error message appears with the full path and other variations!

Presumably you have already successfully put the dayfile onto your server? How did you do that? Surely, instead of just trying different path names, you (with administrative access) should be able to find and read it on your server, that will guide you to how the PHP import could find it. I don't know whether using a file transfer tool could help with finding it?

User avatar
Mapantz
Posts: 485
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Unable to create SQL dayfile table

Postby Mapantz » Sat Mar 17, 2018 10:19 am

It looks to me that you need to white-list your IP address in the 'Remote MySQL' settings on cpanel to allow you to connect and insert data.

12.345.%

etc
Image
Image

forestedge
Posts: 45
Joined: Sun Jul 29, 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Re: Unable to create SQL dayfile table

Postby forestedge » Sun Mar 18, 2018 8:42 pm

Thanks for the responses on this.

Database:tottonwe_dayfile
Presumably that is a database name rather than the name of a table within the database?
Does this database exist yet? If the database exists, but not tables within it, maybe you can use a tool like "phpMyAdmin" to look at it. How you get to that tool (if you have it) depends on your server set up, and so I can't tell you exactly what to type in.

Yes it was the database name now changed to tottonwe_Dayfile to avoid confusion. I can create a table in MYSQL but not save it because it gives message "Missing value in form!"

If the database does not exist, "phpmyadmin" can create a database, and could create a test table for you (you might be able to copy structure from "ImportCumulusFile.php").
See above.

I don't know whether it matters, but I'm using "InnoDB" for all my database accesses, and the PHP I use has some resemblance with that "ImportCumulusFile.php" uses, and I guess therefore matches viewtopic.php?f=27&t=12908&start=15#p107639

I changed to InnoDB but no difference!

Presumably you have already successfully put the dayfile onto your server? How did you do that? Surely, instead of just trying different path names, you (with administrative access) should be able to find and read it on your server, that will guide you to how the PHP import could find it. I don't know whether using a file transfer tool could help with finding it?

I have to use MYSQL through cpanel, it is not visible using Filezilla unfortunately.

It looks to me that you need to white-list your IP address in the 'Remote MySQL' settings on cpanel to allow you to connect and insert data.
12.345.%

This looked promising as my IP address was not in Remote MySQL so I added it and also tried a % but still no change.

A couple other points
1. What import format should be specified for dayfile.txt direct into MYSQL assuming I could save the table?
2. I have checked user id has privileges. Database tottonwe_Dayfile has no privileges listed, does it need any?

User avatar
jdc
Posts: 134
Joined: Tue Jun 19, 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: Unable to create SQL dayfile table

Postby jdc » Tue Mar 20, 2018 4:59 pm

I'm assuming that you're accessing a db on a remote webserver and you can access the db via the control panel. The error message seems more like a credential problem.
If so, are you sure 'localhost' is correct as hostname and not something like 'db1234.1and1.com'?


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 2 guests