• 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 5 years 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 5 years 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 Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

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

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

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.