Home > Database > Mysql Tutorial > body text

Why Can\'t My Local Virtualhost Connect to My Remote MySQL Server (Error 10060)?

DDD
Release: 2024-11-20 11:30:02
Original
802 people have browsed it

Why Can't My Local Virtualhost Connect to My Remote MySQL Server (Error 10060)?

Unable to Connect to Remote MySQL Server from Local Virtualhost

When attempting to connect to a remote MySQL server from a local machine virtualhost, users may encounter the error message "Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10060)." This issue can arise despite being able to connect successfully when uploading the PHP file to the server.

Resolution:

To resolve this error, two primary issues must be addressed:

  1. Firewall Configuration: Ensure that the firewall on the server is configured to allow incoming connections on port 3306. This port is used by MySQL for communication.
  2. MySQL User Permissions: Create a user in MySQL who is granted permissions to connect from '%'. This allows the user to connect from any host, including the local virtualhost. Refer to the MySQL manual for specific instructions on user creation and permission granting.

Once both these steps have been implemented, the issue of being unable to connect should be resolved.

The above is the detailed content of Why Can\'t My Local Virtualhost Connect to My Remote MySQL Server (Error 10060)?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template