ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
333 stars 133 forks source link

Error: 85 = Access denied for user #160

Closed emretunali closed 3 years ago

emretunali commented 3 years ago

Hi,

-------------------------------my code..-----------------------------------------

`/* MySQL Connector/Arduino Example : connect

This example demonstrates how to connect to a MySQL server from an Arduino using an Arduino-compatible Ethernet shield. Note that "compatible" means it must conform to the Ethernet class library or be a derivative with the same classes and methods.

For more information and documentation, visit the wiki: https://github.com/ChuckBell/MySQL_Connector_Arduino/wiki.

INSTRUCTIONS FOR USE

1) Change the address of the server to the IP address of the MySQL server 2) Change the user and password to a valid MySQL user and password 3) Connect a USB cable to your Arduino 4) Select the correct board and port 5) Compile and upload the sketch to your Arduino 6) Once uploaded, open Serial Monitor (use 115200 speed) and observe

If you do not see messages indicating you have a connection, refer to the manual for troubleshooting tips. The most common issues are the server is not accessible from the network or the user name and password is incorrect.

Note: The MAC address can be anything so long as it is unique on your network.

Created by: Dr. Charles A. Bell */

include "WiFiEsp.h"

include

//#include

/#include "SoftwareSerial.h" SoftwareSerial Serial1Sw(6, 7); // RX, TX/

define Serial1Sw Serial1

char ssid[] = "mynetworkssid"; // your network SSID (name) char pass[] = "mypassword"; // your network password int status = WL_IDLE_STATUS; // the Wifi radio's status

IPAddress server_addr(0,0,0,0); // IP of the MySQL server here >> I am using a dedicated server ( Centos 7 And Cpanel ). I did not share the ip address. char user[] = "esp8266_test"; // MySQL user login username char password[] = "sqlpass"; // MySQL user login password

char databaseName[] = "esp8266_test";

WiFiEspClient client; MySQL_Connection conn((Client )&client); //MySQL_Cursor cursor;

void setup() { Serial.begin(115200); Serial1Sw.begin(115200);

while (!Serial);

while (!Serial1Sw);

WiFi.init(&Serial1Sw);

// check for the presence of the shield if (WiFi.status() == WL_NO_SHIELD) { Serial.println("WiFi shield not present"); // don't continue while (true); }

// attempt to connect to WiFi network while ( status != WL_CONNECTED) { Serial.print("Attempting to connect to WPA SSID: "); Serial.println(ssid); // Connect to WPA/WPA2 network status = WiFi.begin(ssid, pass); }

// you're connected now, so print out the data Serial.println("You're connected to the network");

printWifiStatus();

Serial.println();

delay(1000);

Serial.println("Connecting..."); if (conn.connect(server_addr, 3306, user, password)) { delay(1000); } else { Serial.println("Connection failed."); conn.close(); } }

void loop() { }

void printWifiStatus() { // print the SSID of the network you're attached to Serial.print("SSID: "); Serial.println(WiFi.SSID());

// print your WiFi shield's IP address IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip);

// print the received signal strength long rssi = WiFi.RSSI(); Serial.print("Signal strength (RSSI):"); Serial.print(rssi); Serial.println(" dBm"); }`

--------------------Serial Terminal Debug-----------------------------------------------------------

`[WiFiEsp] Initializing ESP module [WiFiEsp] Warning: Unsupported firmware 3.0.4 Attempting to connect to WPA SSID: Gobit-19 [WiFiEsp] Connected to Gobit-19 You're connected to the network SSID: Gobit-19 IP Address: 192.168.1.36 Signal strength (RSSI):-50 dBm

Connecting... ...MYSQL BAGLANIYOR... [WiFiEsp] Connecting to 0.0.0.0 [WiFiEsp] TIMEOUT: 47 Error: 85 = Access denied for user 'esp8266_test'@'0.0.0.0' (using password: YES). Connection failed. `

---------------Send Data ESP8266 TO Arduino Mega Terminal Review--------------------------

`ready ATE0

OK

OK

OK

OK

OK

OK AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) compile time:May 27 2020 10:12:17 Bin version(Wroom 02):1.7.4 OK STATUS:5

OK WIFI CONNECTED WIFI GOT IP

OK +CWJAP:"Gobit-19","28:28:5d:4c:cf:11",10,-50,0

OK +CIFSR:STAIP,"192.168.1.36" +CIFSR:STAMAC,"fc:f5:c4:93:fb:e2"

OK +CWJAP:"Gobit-19","28:28:5d:4c:cf:11",10,-50,0

OK 3,CONNECT

OK

+IPD,3,0.0.0.0,3306:J
5.7.31 2 P 1kn90 ÿÿ ÿÁ )pjBvvl mysql_native_password OK

Recv 71 bytes

SEND OK

+IPD,3,89,0.0.0.0,3306:U ÿ#28000Access denied for user 'esp8266_test'@'0.0.0.0' (using password: YES)3,CLOSED`

-------------Send Data Arduino Mega TO ESP8266 Terminal Review--------------------------------------

AT AT+RST ATE0 AT+CWMODE=1 AT+CIPMUX=1 AT+CIPDINFO=1 AT+CWAUTOCONN=0 AT+CWDHCP=1,1 AT+GMR AT+CIPSTATUS AT+CWJAP_CUR="Gobit-19","mypass" AT+CWJAP? AT+CIFSR AT+CWJAP? AT+CIPSTART=3,"TCP","0.0.0.0",3306 AT+CIPSEND=3,71 C  ¦  esp8266_test ª%½5üÍNO~Gx«õ]ª…u

Remote mysql access permission granted. The ESP library I use. > https://github.com/bportaluri/WiFiEsp

Whatever I did I could not connect. Where am I making a mistake?

Thank You.

ChuckBell commented 3 years ago

You did not specify a valid IP address for the MySQL server. 0.0.0.0 is not valid.

emretunali commented 3 years ago

You did not specify a valid IP address for the MySQL server. 0.0.0.0 is not valid.

Thank you for your quick reply. I did not share my ip address because it is a dedicated server. I solved the problem. It originates from the ESPWifi library. Data communication with the server was not healthy because the communication was overflowing. https://github.com/jandrassy/WiFiEspAT Using the updated library the problem was resolved. Everything is working very well now. Thank you very much for the library.

Best Regards...

ChuckBell commented 3 years ago

Good. Please close the ticket.

On Sun, Oct 18, 2020 at 16:10 Emre TUNALI notifications@github.com wrote:

You did not specify a valid IP address for the MySQL server. 0.0.0.0 is not valid.

Thank you for your quick reply. I did not share my ip address because it is a dedicated server. I solved the problem. It originates from the ESPWifi library. Data communication with the server was not healthy because the communication was overflowing. https://github.com/jandrassy/WiFiEspAT Using the updated library the problem was resolved. Everything is working very well now. Thank you very much for the library.

Best Regards...

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/160#issuecomment-711415353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYBAILQDSQPJ3C25W5DSLNDT7ANCNFSM4SVIKV3Q .