pymysql.err.OperationalError: (1130, "DESKTOP-2ORTOID' is not allowed to connect to this MySQL server")
时间: 2024-02-16 15:31:37 浏览: 173
MYSQL不能从远程连接的一个解决方法(s not allowed to connect to this MySQL server)
This error message typically occurs when you try to connect to a MySQL server from a remote machine and your IP address or hostname is not authorized to connect.
To resolve this issue, you need to grant access to the remote machine by adding its IP address or hostname to the MySQL server's list of allowed hosts.
You can do this by logging into the MySQL server as a root user and running the following command:
```
GRANT ALL PRIVILEGES ON *.* TO 'root'@'remote_machine_ip' IDENTIFIED BY 'password';
```
Replace 'remote_machine_ip' with the IP address of the machine you want to connect from, and 'password' with the password you want to use for the root user.
After running this command, you should be able to connect to the MySQL server from the remote machine without any issues.
阅读全文