can not connect to mysql

my xampp is on and the port and sql user already same

this is my arduino to sql program

#include <Ethernet.h>
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>

byte mac_addr = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

IPAddress server_addr(192,168,1,155); // IP of the MySQL server here
char user = “root”; // MySQL user login username
char password = “”; // MySQL user login password

// Sample query
char INSERT_SQL = “INSERT INTO test_arduino.hello_arduino (message) VALUES (‘Hello, Arduino!’)”;

EthernetClient client;
MySQL_Connection conn((Client *)&client);

void setup() {
while (!Serial); // wait for serial port to connect
if (conn.connect(server_addr, 3306, user, password)) {
Serial.println(“Connection failed.”);

void loop() {

Serial.println(“Recording data.”);

// Initiate the query class instance
MySQL_Cursor *cur_mem = new MySQL_Cursor(&conn);
// Execute the query
// Note: since there are no results, we do not need to read any data
// Deleting the cursor also frees up memory used
delete cur_mem;

and this is my ethernet to arduino program

#include <EtherCard.h>

// ethernet interface mac address, must be unique on the LAN
static byte mymac = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
static byte myip = { 192,168,1,155 };

byte Ethernet::buffer[500];
BufferFiller bfill;

static word homePage() {
long t = millis() / 1000;
word h = t / 3600;
byte m = (t / 60) % 60;
byte s = t % 60;
bfill = ether.tcpOffset();
“HTTP/1.0 200 OK\r\n”
“Content-Type: text/html\r\n”
“Pragma: no-cache\r\n”
“RBBB server”


h/10, h%10, m/10, m%10, s/10, s%10);
return bfill.position();

void setup () {
Serial.println(F("\n[RBBB Server]"));
// Change ‘SS’ to your Slave Select pin, if you arn’t using the default pin
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println(F(“Failed to access Ethernet controller”));

void loop () {
word len = ether.packetReceive();
word pos = ether.packetLoop(len);

if (pos) // check if valid tcp data is received
ether.httpServerReply(homePage()); // send web page data

anyone can help me?

Welcome to the forums. Take some time to read the sticky post at the top of the forum about how to properly post your code using code tags. It helps helps people help you. After doing so, go back and edit your post and put your code inside code tags.