PaulRB / WemosSensor

Indoor Temp, Humidity and/or Barometric pressure sensor using Wemos D1 Mini
43 stars 6 forks source link

Connection failed #3

Closed williamesp2015 closed 3 years ago

williamesp2015 commented 5 years ago

I am using ESP32 (platform: arduino-esp32) and before I connect sensors I tested by random values: temperatureNow= random(20); battLevelNow= random(10); humidityNow= random(30); pressureNow = random(1000); I changed $servername and then copied four php files in my website under SQL sub-directory. When sending data it says: .OK WiFi connected, IP address: 192.168.0.45

connecting to www.MYURL.com Requesting URL: /SQL/script.php?sensor=TC,BC,HC&value=17.00,1.00,17.00 HTTP/1.1 200 OK Date: Mon, 22 Apr 2019 13:33:25 GMT Server: Apache/2 X-Powered-By: PHP/5.4.45 Vary: Accept-Encoding,User-Agent

Connection: close Transfer-Encoding: chunked Content-Type: text/html

57 Connection failed: Access denied for user 'hostuserid'@'veyq.net' (using password: YES) 0

closing connection Total time: 1115 Sleeping...! ///////////////// I am wondering what file is the database to save data into it and How set the username and password !!!?

PaulRB commented 4 years ago

Hi, the database is not in a "file". It is a MySQL database hosted on the same server, although it could be hosted elsewhere. Inside each of the .php files, you will see where to set the hostname of the server running mySQL, the user id, password and database name. You can decide the user id, password and database name when you create the database. In my case I did these things through an app called myPHPadmin which was also installed on the server I used, but I also provided an SQL script to create the database tables.