#include "Ethernet.h"
#include "MySQL_Connection.h"
byte mac_addr[] = { 0x04, 0xD3, 0xB0, 0x33, 0xB5, 0x9E };
IPAddress server_addr(127,0,0,1); // IP of the MySQL *server* here
char user[] = "root"; // MySQL user login username
char password[] = "worldoftanks228FGHJK"; // MySQL user login password
EthernetClient client;
MySQL_Connection conn((Client *)&client);
void setup() {
Serial.begin(115200);
while (!Serial); // wait for serial port to connect
//Serial.println(WiFi.macAddress());
Ethernet.begin(mac_addr);
Serial.println("Connecting...");
if (conn.connect(server_addr, 3306, user, password)) {
delay(1000);
// You would add your code here to run a query once on startup.
}
else
Serial.println("Connection failed.");
conn.close();
}
void loop() {
// if (Serial.available() > 0) { // Check if data is available
// byte incomingByte = Serial.read(); // Read the byte
// Serial.write(incomingByte); // Print the received byte
// //delay(10);
// }
}