Closed jorgher closed 2 years ago
The message from the manual in page 9 is:
Connecting... Connected to server version 5.7.9-log Query Success!
First, the reason you are not seeing a similar message as shown in the manual on connection is because you are not using MySQL. Specifically, you are using a non-Oracle maintained variant. This variant is known to differ from Oracle MySQL and because of those differences, the connector is not guaranteed to work with non-Oracle MySQL variants. That said, some have had great success, but officially it is not supported. I suggest you install Oracle's MySQL and try it with that. You should see a similar response on connection.
Second, you said you're using an ESP8266 and a Wemos. Perhaps I read something or am misunderstanding, but aren't both of these WiFi? In that case, using the Ethernet library isn't going to work. Frankly, I'm amazed you did not see any errors in your sketch. I suggest you use the ESP8266WiFi class in your sketch connecting first to your WiFi and then to MySQL (Oracle's MySQL).
Debugging issues like these are always best done with a set of known working configuration items. In this case, the connector does work with ESP8266 using the ESP8266WiFi library and Oracle's MySQL. Variations on that theme may not have the same results.
Also, you should check the return code from the query. It may give you a clue if there are any error messages. You can do this in a number of ways, but the easiest is to check to see if the execute() returns False, which means the query failed. So, your sketch isn't checking for that condition and thus it may seem like the query is working. A deeper dive would require modifying the connector code directly to print out the return packet from the server - something that may appear in a future release, but for now you can do it manually - ask me for the details if you want to go this route. However, adding the if statement for the execution should be enough.
Closed due to inactivity. Please open a new ticket if this is still relevant.
Reading all issues related found that there is something different with the one I sent.
the serial window show that there is a connection with SQL Figure 1, but there is a different message from the one in the manual. Where the library respond with the version of the SQL
besides that I modify the sketch see below;
when running (notice that in this is used Ethernet library) have a connection and a series of data input messages, see Figure 3, but when checking table from mariaDB there were no input in table Figure 4.