Sending data from Arduino to MySQL

I am trying to send data from ultrasonic sensors and my DHT22 Temperature and Humidity sensors to mySQL Database named 'node-red'. However, when I try uploading the code it gives me an 'error compiling for board to Arduino/Genuino Uno'. I usually restart my whole system and the code works after such an error, but it dosen't fix the problem in this case. I am using Arduino IDE 1.8.10 and followed the instructions here:
http://commenthow.com/article/display/5218/0/Connecting+Arduino+to+MySQl+database+w%252F+USB+using+MysqlIO

However, after following the instructions, I am stuck at Step 4. Any advice?

#include <DHT.h>;
#include <Servo.h>
#include <mysql.h>

//Constants
#define DHTPIN 2     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

const int trigPin = 9;
const int echoPin = 10;
const int trigPin1 = 6;
const int echoPin1 = 7;
const int trigPin2 = 11;
const int echoPin2 = 12;

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value
long duration;
float distance;
long duration1;
float distance1;
long duration2;
float distance2;
char *host, *user, *pass, *db;
int isconnected = 0;
Servo servo;

void setup()
{
 pinMode(LED_BUILTIN, OUTPUT);
 servo.attach(8);
 pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
 pinMode(echoPin, INPUT); // Sets the echoPin as an Input
 pinMode(trigPin1, OUTPUT); // Sets the trigPin as an Output
 pinMode(echoPin1, INPUT); // Sets the echoPin as an Input
 pinMode(trigPin2, OUTPUT); // Sets the trigPin as an Output
 pinMode(echoPin2, INPUT); // Sets the echoPin as an Input
   Serial.begin(9600);
 dht.begin();
 host = "192.168.1.76";
 user = "root";
 pass = "LINUX@1991v6";
 db = "node-red";
 isconnected = mysql_connect(host,user,pass,db);
 if(isconnected){
   Serial.print("Connected to ");
               Serial.println(host);
 }
 else{
   Serial.println("Connection failed.");
 }
 mysql_close();
}


void loop(){
 infront();
 rightside();
 leftside();
 temperature();
}

void temperature()
{
   //Read data and store it to variables hum and temp
   hum = dht.readHumidity();
   temp= dht.readTemperature();
   //Print temp and humidity values to serial monitor
   Serial.print(hum);
   Serial.print(" , ");
   Serial.print(temp);
   Serial.print(" , ");
   Serial.print(distance);
   Serial.print(" , ");
   Serial.print(distance1);
   Serial.print(" , ");
   Serial.print(distance2);
   Serial.println();
   delay(500); //Delay 2 sec.
}

void infront() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;
if (distance < 100){
 servo.write(90);
     delay(100);
     servo.write(0);
     delay(100);
     digitalWrite(LED_BUILTIN, HIGH);
     delay(100);  
}
else{
   servo.write(0);
   digitalWrite(LED_BUILTIN, LOW);
}
delay(100);
}

void leftside() {
// Clears the trigPin
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration1 = pulseIn(echoPin1, HIGH);

// Calculating the distance
distance1= duration1*0.034/2;
if (distance1 < 100){
 servo.write(90);
     delay(100);
     servo.write(0);
     delay(100);
     digitalWrite(LED_BUILTIN, HIGH);
     delay(100);  
}
else{
    servo.write(0);
    digitalWrite(LED_BUILTIN, LOW);
}
delay(100);
}

void rightside() {
// Clears the trigPin
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration2 = pulseIn(echoPin2, HIGH);

// Calculating the distance
distance2= duration2*0.034/2;
if (distance2 < 100){
 servo.write(90);
     delay(100);
     servo.write(0);
     delay(100);
     digitalWrite(LED_BUILTIN, HIGH);
     delay(100);  
}
else{
    servo.write(0);
    digitalWrite(LED_BUILTIN, LOW);
}
delay(100);
}

The error is shown below:
Arduino: 1.8.10 (Linux), Board: "Arduino/Genuino Uno"

/home/thomas/Documents/Temp/Temp.ino:1:17: warning: extra tokens at end of #include directive
#include <DHT.h>;
^
/home/thomas/Documents/Temp/Temp.ino: In function 'void setup()':
/home/thomas/Documents/Temp/Temp.ino:43:10: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
host = "localhost";
^~~~~~~~~~~
/home/thomas/Documents/Temp/Temp.ino:44:10: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
user = "root";
^~~~~~
/home/thomas/Documents/Temp/Temp.ino:45:10: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
pass = "LINUX@1991v6";
^~~~~~~~~~~~~~
/home/thomas/Documents/Temp/Temp.ino:46:8: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
db = "node-red";
^~~~~~~~~~
/home/thomas/Arduino/libraries/mysql/mysql.cpp: In function 'int mysql_connect(char*, char*, char*, char*)':
/home/thomas/Arduino/libraries/mysql/mysql.cpp:31:5: error: redefinition of 'int mysql_connect(char*, char*, char*, char*)'
int mysql_connect(char *host, char *user, char *pass, char *db){

^~~~~~~~~~~~~
/home/thomas/Arduino/libraries/mysql/mysql.cpp:10:5: note: 'int mysql_connect(char*, char*, char*, char*)' previously defined here
int mysql_connect(char *host, char *user, char *pass, char *db){

^~~~~~~~~~~~~
/home/thomas/Arduino/libraries/mysql/mysql.cpp: In function 'String mysql_result_query(String, String)':
/home/thomas/Arduino/libraries/mysql/mysql.cpp:67:10: error: conversion from 'int' to 'String' is ambiguous
return 0;

^
In file included from /home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/Arduino.h:231:0,
from /home/thomas/Arduino/libraries/mysql/mysql.cpp:7:
Multiple libraries were found for "mysql.h"
Used: /home/thomas/Arduino/libraries/mysql
Multiple libraries were found for "Adafruit_Sensor.h"
Used: /home/thomas/Arduino/libraries/Adafruit_Unified_Sensor
Multiple libraries were found for "DHT.h"
Used: /home/thomas/Arduino/libraries/DHT_sensor_library
Multiple libraries were found for "Servo.h"
Used: /home/thomas/Downloads/arduino-1.8.10/libraries/Servo
/home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/WString.h:61:2: note: candidate: String::String(const __FlashStringHelper*)
String(const __FlashStringHelper str);
^~~~~~
/home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: candidate: String::String(const char
)
String(const char *cstr = "");
^~~~~~
/home/thomas/Arduino/libraries/mysql/mysql.cpp:71:10: error: conversion from 'int' to 'String' is ambiguous
return 0;

^
In file included from /home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/Arduino.h:231:0,
from /home/thomas/Arduino/libraries/mysql/mysql.cpp:7:
/home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/WString.h:61:2: note: candidate: String::String(const __FlashStringHelper*)
String(const __FlashStringHelper str);
^~~~~~
/home/thomas/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/WString.h:59:2: note: candidate: String::String(const char
)
String(const char *cstr = "");
^~~~~~
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It's that smily in your code :slight_smile: Just joking, please read How to use this forum - please read. - Installation & Troubleshooting - Arduino Forum, specifically point #7 about posting code. Next edit your post and apply the code tags.

Without knowing what the error message is, nobody will be able to help. When an error occurs, you should see a button "copy error messages"; click it and the errors will be copied to the clipboard. Next you can post them here; if it exceeds 9000 characters, paste them in a file, save the file and attach.

Further, please provide details where you got the libraries from that you use and the version of the IDE.

PS
It's unlikely that compile errors are solved by rebooting your system (PC, I assume?). Upload errors I can imagine, compile errors not. Hence the question about the version of the IDE.