• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Visualize Your Sensor Readings from Anywhere in the World (ESP32/ESP8266 + MySQL + PHP)

Q&A Forum › Category: ESP8266 › Visualize Your Sensor Readings from Anywhere in the World (ESP32/ESP8266 + MySQL + PHP)
0 Vote Up Vote Down
william mckinley asked 9 months ago

Constant error with this app note, On Bluehost
Connection failed: Access denied for user ‘bill’@’localhost’ (using password: YES)
SQL Query
CREATE TABLE sensor_data (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
value1 VARCHAR(10),
value2 VARCHAR(10),
value3 VARCHAR(10),
reading_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
I copy and pasted the text for both of the PHP files, Database name, username, and password verified multiple times.
$value1 = json_encode(array_reverse(array_column($sensor_data, ‘value1’)), JSON_NUMERIC_CHECK);
$value2 = json_encode(array_reverse(array_column($sensor_data, ‘value2’)), JSON_NUMERIC_CHECK);
$value3 = json_encode(array_reverse(array_column($sensor_data, ‘value3’)), JSON_NUMERIC_CHECK);
$reading_time = json_encode(array_reverse($readings_time), JSON_NUMERIC_CHECK);

http://example.com/post-data.php is functional
http://example.com/esp-chart.php fails with access denied

I have repeated Bluehost cpanel configuration 4 separate times, every attempt fails
on the esp=chart test.

Suggestions ?

 
 

1 Answers
0 Vote Up Vote Down
william mckinley answered 9 months ago

App note is incorrect on database naming. The Bluehost database creation app prefixes the database name and username with (in my case ) “compuwe6_” and limits username to 7 characters. Subsequently in the PHP file creation this prefix has to be added to the credentials  IE:
// REPLACE with your Database name
$dbname = “compuwe6_esp_data”;
// REPLACE with Database user
$username = “compuwe6_espbrd”;
If you follow the application note very closely, you will go down the rabbit hole, and the PHP will fail with the above listed error.  Everything will look correct code-wise, but since the application note directly references Bluehost for the build, it should be updated to correctly reflect the the IDE environment.
 I am a newbie to this type of development, 30+ years of C, but new to web based applications.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Released] Build Web Servers with ESP32 and ESP8266 (version 1.0) October 27, 2020
  • [eBook Updated] Download Build ESP32-CAM Projects using Arduino IDE (version 1.1) August 31, 2020

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2021 · RandomNerdTutorials.com · All Rights Reserved