Cant connect manually to MYSQL

Im new to fivem but im not to c#, i wanted to connect to mysql using my own resource.
Ive specified a correct connection string, because i can connect with it in other programs, but connection.Ping() always return false. Its like fivem is blocking the connection with mysql or something like that.

My code

MySqlConnection con = new MySqlConnection("Server=127.0.0.1;Port=3306;Database=fivem;Uid=root;Pwd=*********");
Console.WriteLine(con.Ping());