Reason analysis:
Host 'Local' is not allowed to connect to this MySQL server Typical remote permissions problem.
The crux of the problem:
MySQL does not allow remote login permissions. It depends on what kind of system your server uses, whether it is Linux or Windows. The solution is different. You can search online and there is a lot of information on solving the problem.
Solution:
There are two major steps to open a MySQL remote login account:
1. Make sure the firewall on the server does not block port 3306.
The default port of MySQL is 3306. You need to make sure that the firewall does not block port 3306, otherwise you will not be able to connect to MySQL remotely through port 3306.
If you specified another port when installing MySQL, please open the port number you specified for MySQL in the firewall.
If you don't know how to set up the firewall on your server, please ask your server administrator.
2. Add the ability to allow remote connection to MySQL users and authorize them.
1) First log in to MySQL with the root account
Click the Start menu on the Windows host, run, enter "cmd", enter the console, enter the MySQL bin directory, and enter the following command.
Enter the following command at the command prompt on the Linux host.
Copy the code code as follows:
> MySQL -uroot -p123456
123456 is the password of the root user.
2) Create a remote login user and authorize it
Copy the code code as follows:
> grant all PRIVILEGES on discuz.* to ted@'123.123.123.123' identified by '123456';
The above statement indicates that all permissions of the discuz database are granted to the user ted, the user ted is allowed to remotely log in at the IP address 123.123.123.123, and the password of the user ted is set to 123456.
Let’s analyze all parameters one by one:
all PRIVILEGES means granting all permissions to the specified user. It can also be replaced by granting a specific permission, such as: select, insert, update, delete, create, drop, etc. The specific permissions are separated by "," half-width commas.
discuz.* indicates which table the above permissions are for. discuz refers to the database, and the following * indicates for all tables. It can be inferred that the authorization for all tables in all databases is "*.*", and for all tables in all databases, the authorization is "*.*". The authorization for all tables in a certain database is "database name.*", and the authorization for a certain table in a certain database is "database name.table name".
ted indicates which user you want to authorize. This user can be an existing user or a non-existent user.
123.123.123.123 indicates the IP address that allows remote connections. If you want not to restrict the IP address of the connection, just set it to "%".
123456 is the user's password.
After executing the above statement, execute the following statement to take effect immediately.
Copy the code code as follows:
>flush privileges;