PHP connection MySQL problem

Source: Internet
Author: User

Background of the problem:

My local machine do:
Intranet Server machine Multiple units: server_a Server_b
Personal Extranet machine: Net
Now the local server_a server_b net has MySQL and PHP

The problem is this.

PHP code is the simplest mysql_connect connection database, the same code

# -> :标示请求数据, =》:标示结果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 the local PHP connection server_a will be problematic.
数据库配置和php代码完全一样
Ask the big God for possible reasons

Reply content:

Background of the problem:

My local machine do:
Intranet Server machine Multiple units: server_a Server_b
Personal Extranet machine: Net
Now the local server_a server_b net has MySQL and PHP

The problem is this.

PHP code is the simplest mysql_connect connection database, the same code

# -> :标示请求数据, =》:标示结果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 the local PHP connection server_a will be problematic.
数据库配置和php代码完全一样
Ask the big God for possible reasons

Your local service is not in a network with the server, if it is not on the Internet, then we can not talk about access.
If you're on a network, or if you have an external port, check to see if MySQL in the server has permission to open external access.

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

That's wrong.

Is it the same as a network segment? MySQL user is not%?

  • 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.