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.
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
Please sign in to leave a comment.
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.
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');