MySQL strange error Host 127.0.0.1 is not allowed to connect

I have an issue with MySQL
In PhpStorm, when i create a new connection i have a strange issue.

http://liparistudios.hostinggratis.it/personal/phpStormMySQL_error.png

if i use other application ( terminal, database-app, etc... ) for connect to my MySQL, it work!!!!
I have problem only in phpStorm!

PS
I use the this driver mysql-connector-java-5.1.35-bin.jar

3 comments
Comment actions Permalink

Hi there,

What's your connection details?

Try using "localhost" instead of "127.0.0.1" for the server's address.

If that will do then most likely you have configured MySQL to disallow connecting via TCP sockets.

0
Comment actions Permalink
I solved in this way:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
0
Comment actions Permalink

You might want to run this:
     SELECT User, Host, Password FROM mysql.user;

You might see something like this:

+------+-----------+----------+
| User | Host      | Password |
+------+-----------+----------+
| root | localhost |          |
| root | 127.0.0.1 |          |
| root | ::1       |          |
|      | localhost |          |  <<< this is an anonymous user!
+------+-----------+----------+
4 rows in set (0.00 sec)

You might want to then do this.
SET PASSWORD FOR 'root'@'localhost'= PASSWORD('THEPASSWORD');
SET PASSWORD FOR 'root'@'127.0.0.1'= PASSWORD('THEPASSWORD');
SET PASSWORD FOR 'root'@'::1' = PASSWORD('THEPASSWORD');

For the anonymous user you can set the password unless you want anonymous connections.
SET PASSWORD FOR ''@'localhost'= PASSWORD('THEPASSWORD');

0

Please sign in to leave a comment.