I would like to ask you a question about cross-server database access in php + mysql.

Source: Internet
Author: User
I would like to ask you a question about cross-server database access in php + mysql: on server A, how does the php program store data on server B through the php program on server B? I do not know whether to express it clearly: there is A problem where two machine programs process data on machine A in the database on Machine B in Machine A, and then I will ask you A question about cross-server database access in php + mysql.
I would like to ask you a question about cross-server database access:
Php program on server A and database on server B
On server A, how does one store data in the database of server B through the php program?

I do not know whether to express it clearly:
It is as simple as two machine programs on machine A, databases on Machine B, processes data on machine A, and then stores the processed data into the database on Machine B.


Please give us some ideas and thank you! I wish you a better life and a better fortune.

------ Solution --------------------
If you have the permission, directly use the IP address to connect to the server.
------ Solution --------------------
The host address, account, and password can be used to connect to mysql, that is, remote connection.
------ Solution --------------------
Is the connection to the mysql server not specified by you? Specify the host. It is no different from operating mysql on the server.
------ Solution --------------------
Is a word: Slow
------ Solution --------------------
Permission required
------ Solution --------------------
1. server A and server B are both in the same network segment (same data center), so that the network speed will not be greatly affected. if conditions are met, you can set up an intranet in the data center, and both the formal data center will allow, that is, the RMB issue.
2. server B database opens the account remotely or externally or to server A with Port 3306
3. change the host of program A to B.
4. there is a configuration in the Mysql settings of server B that detects the domain name of the server.

This is basically the case.

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.