Php connection to mysql

Source: Internet
Author: User
Problem Background: My local machine is recorded as: there are multiple servers on the local Intranet: server_aserver_ B: net now localserver_aserver_bnet has issues with mysql and php. This php code is the simplest mysql_connect connection... background:

My local machine logs as: local
Multiple Intranet servers: server_a server_ B
Personal Internet machine: net
Currently, both mysql and php are available on local server_a server_ B net.

This is the problem.

The php code is the simplest mysql_connect connection to the database. The Code is the same.

#->: Request data, =: result: local php-> local mysql => oklocal php-> server_a mysql => errorlocal php-> net mysql => okserver_a php-> server_a mysql => okserver_ B php-> server_a mysql => OK

Why does the local php connection to server_a fail.
The database configuration is exactly the same as the php code.
Could you give me some advice?

Reply content: Background:

My local machine logs as: local
Multiple Intranet servers: server_a server_ B
Personal Internet machine: net
Currently, both mysql and php are available on local server_a server_ B net.

This is the problem.

The php code is the simplest mysql_connect connection to the database. The Code is the same.

#->: Request data, =: result: local php-> local mysql => oklocal php-> server_a mysql => errorlocal php-> net mysql => okserver_a php-> server_a mysql => okserver_ B php-> server_a mysql => OK

Why does the local php connection to server_a fail.
The database configuration is exactly the same as the php code.
Could you give me some advice?

Whether your local service is in the same network as the server. If you are not in the same network, you won't be able to access it.
If a network or external port is directly connected, check whether mysql on the server has the permission to enable external access.

Http://www.cnblogs.com/qq78292959/archive/2012/05/17/2505832.html

Wrong...

Is the CIDR block the same? Is the mysql user %?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.