mysql Error Code: 1130

0

yesterday my mysql worked fine and now I start it and I want to enter my bd I get this error host localhost is not allowed to connect to this mysql server

  

and in error details

Error Code: 1130
This error occurs because you don't have a permission to connect to MySQL server from your host. Please contact your database administrator or, if you have access to MySQL server with grant privilege, you can use the GRANT statement to add a new user. For example, the following command will give full access from your host to the user:
/*!50003 CREATE USER 'user'@'user_host'*/;
GRANT ALL PRIVILEGES ON *.* TO 'user'@'user_host' IDENTIFIED BY 'user_password';
    
asked by hubman 08.04.2017 в 06:30
source

1 answer

0

In your host you must create the user assigning the different segmentations of the routes by which you can access as they are, "%", "127.0.0.1", "localhot" and "0.0.0.0", for example:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

With this structure you should be able to log in from another remote server.

    
answered by 08.04.2017 в 18:50