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[] = "192.168.1.3"; 
    
    /* 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);
      Serial.begin(9600);
      delay(1000);
      Serial.println("Connecting...");
      if (my_conn.mysql_connect(server_addr, 3306, user, password))
      {
        delay(500);
        Serial.println("Connection Successfull,inserting to database.");
         /* Write Hello, World to MySQL table test_arduino.hello */
         my_conn.cmd_query(INSERT_SQL);
         Serial.println("Query Success!"); 
      } 
      else
        Serial.println("Connection failed.");
    }
    
    void loop() {
    }

I am getting the error in serial Monitor:

> Connecting... 

> Error: 76 = Access denied for user
> 'root'@'192.168.1.177' (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'@'192.168.1.177';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SELECT host FROM mysql.user WHERE User = 'root';
    +---------------+
    | host          |
    +---------------+
    | 127.0.0.1     |
    | 192.168.1.177 |
    | ::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.