MySQL Forums :: Connector/Arduino :: Helps to achieve connect

Advanced Search

Helps to achieve connect
Posted by: Miguel martinez ()
Date: October 10, 2014 12:38AM

Now I have the information of my sensors, I only need to pass it to mysql.

This is my try sketch:

#include "SPI.h"
#include "Ethernet.h"
#include "sha1.h"
#include "mysql.h"

/* Setup for Ethernet Library */
byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 10);
IPAddress gw(192, 168, 1, 1);
IPAddress sn(255, 255, 255, 0);

IPAddress server_addr(192, 168, 1, 3);

/* Setup for the Connector/Arduino */
Connector my_conn; // The Connector/Arduino reference

char user[] = "root";
char password[] = "" ;
char INSERT_SQL[] = "INSERT INTO VALUES ('Hello, MySQL!', 77)";

void setup() {

void loop() {
Serial.print("Local IP is: ");
if (my_conn.mysql_connect(server_addr, 3306, user, password))
/* Write Hello, World to MySQL table test_arduino.hello */
Serial.println("Query Success!");
Serial.println("Connection failed.");

... But the serial monitor only says:
Connection failed.

There is something special to configure the mysql to accept the orders of the connector library?

Options: ReplyQuote

Subject Views Written By Posted
Helps to achieve connect 1844 Miguel martinez 10/10/2014 12:38AM
Re: Helps to achieve connect 953 Charles Bell 10/14/2014 02:09PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.