Solution when connecting to MySQL: Host is not allowed to connect to this MySQL server
- The reason for the error?
English translation --- 'The host is not allowed to connect to this MySQL server' (meaning that local account connection can log in,but remote login cannot)
-
Solution steps
-
Open cmd and enter the bin file of php
- Execute the following commands in order
1): mysql -u root -p This step is to connect to the database and enter the password (usually the original password)
2): use mysql;
3): update user set host = '%' where user = 'root';
- : FLUSH PRIVILEGES;