Skip to main content

Solution when connecting to MySQL: Host is not allowed to connect to this MySQL server

  1. 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)

  1. Solution steps

  2. Open cmd and enter the bin file of php

  1. 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';

  1. : FLUSH PRIVILEGES;