Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Host is not allowed to connect to this mysql server when making a local connection [closed]

When I try to connect with putty I get 'host is not allowed to connect to this mysql server'. Why is that happening? Host and client are on my machine.

When I connect with the command line it connects.

like image 379
kul_mi Avatar asked Dec 05 '12 20:12

kul_mi


1 Answers

You need to change how your configuration is set up.

Comment out the skip-networking section within your MySQL config: # skip-networking, if you have skip-networking it will discard any TCP/IP connection which is likely why your failing.

Once you have enabled your TCP/IP connections you will need to grant permission to your user to connect from other machines:

GRANT ALL PRIVILEGES ON *.* TO <username>@'%' IDENTIFIED BY '<password>';

This will let username connect from any machine to your database with the appropriate password.

like image 147
Robert H Avatar answered Oct 27 '22 00:10

Robert H