Connect Java system to the database on the server

0

I have a Desk system in which I'm trying to connect to a database that stays on the server. But every time I try to connect it gives the following error:

  

java.sql.SQLException: null, message from server: "Host   'nco-inf-04.cop.com.br' is not allowed to connect to this MySQL   server "

How do I release permission for all users who will have the system installed?

Connection Class:

public class Conexao {

    private static final String USUARIO = "root";
    private static final String SENHA = "";
    private static final String URL = "jdbc:mysql://10.70.111.24:3306/db_prestadores";
    private static final String DRIVER = "com.mysql.jdbc.Driver";

    // Conectar ao banco
    public static Connection abrir() throws Exception {
        // Registrar o driver
        Class.forName(DRIVER);
        // Capturar a conexão
        Connection conn = DriverManager.getConnection(URL, USUARIO, SENHA);
        // Retorna a conexao aberta
        return conn;

    }

}

WorkBench:

    
asked by anonymous 12.08.2015 / 13:28

1 answer

1

I solved the problem by creating a new user:

    
13.08.2015 / 14:47