getting permission denied when trying to upload to mysql server directly

I am using the below mysql example sketch to upload data directly to mysql db.

    #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 };
    // Set the static IP address to use if the DHCP fails to assign
    IPAddress ip(192, 168, 1, 177);
    IPAddress server_addr(192, 168, 1, 3);
    //char server_addr[] = ""; 
    /* Setup for the Connector/Arduino */
    Connector my_conn; // The Connector/Arduino reference
    char user[] = "root";
    char password[] = "secret";
    char INSERT_SQL[] = 
     "INSERT INTO test_arduino.hello VALUES ('Hello, MySQL!', NULL)";
    void setup() {
      Ethernet.begin(mac_addr, ip);
      if (my_conn.mysql_connect(server_addr, 3306, user, password))
        Serial.println("Connection Successfull,inserting to database.");
         /* Write Hello, World to MySQL table test_arduino.hello */
         Serial.println("Query Success!"); 
        Serial.println("Connection failed.");
    void loop() {

I am getting the error in serial Monitor:

> Connecting... 

> Error: 76 = Access denied for user
> 'root'@'' (using password: YES).

>  Connection failed.

even when I have all prvialages on root user for the ip of client !

    mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'';
    Query OK, 0 rows affected (0.00 sec)
    mysql> SELECT host FROM mysql.user WHERE User = 'root';
    | host          |
    |     |
    | |
    | ::1           |
    | localhost     |
    | raspberrypi   |
    5 rows in set (0.00 sec)

then what am I missing ? please help.

Sounds like a problem for the RPi forum.

It has been a while since I was working in that area, but it seems to me root is a special case and has permissions for not only a local root but a remote root (wifi etc.) which is disabled by default. That is to prevent someone from setting up their own little machine (even a RPi), giving themselves root privilege then getting into another machine as root that way.