Analysis and Solution to the Problem that PHP cannot access remote mysql. First, the remote server can be accessed remotely. The problem I encountered was: There are three servers A, B, and C, and C is the server. B can use PHP to successfully connect to mysql ON MACHINE C, while machine A cannot connect! It can be said that it is certainly not a problem with the code, and the mysql settings on the server are not
Analysis and Solution to the Problem that PHP cannot access remote mysql. First, the remote server can be accessed remotely. The problem I encountered was: There are three servers A, B, and C, and C is the server. B can use PHP to successfully connect to mysql ON MACHINE C, while machine A cannot connect! It can be said that it is certainly not a problem with the code, and the mysql settings on the server are not
Analysis and Solution of remote mysql access failure in PHP
The remote server can be accessed remotely.
The problem I encountered was: There are three servers A, B, and C, and C is the server. B can use PHP to successfully connect to mysql ON MACHINE C, while machine A cannot connect!
It can be said that it is certainly not a problem with the code, and the mysql settings on the server are also OK, because the B server can all be used.
It must have been A problem with machine A's settings!
I searched on the Internet and found that mysql authorization problems, php. ini modification, and firewall modification were not actually caused by these problems.
Similar to the problem discussed on this page, but no one gives the result, link: http://bbs.csdn.net/topics/90284141
Finally, I thought about the SELINUX problem. I compared the two AB machines and set them differently! It's probably a problem!
The following settings are made:
Root, use vim to open the file/etc/selinux/config
Modify the value of SELINUX:
# SELINUX = enforcing
SELINUX = disabled
Save and exit.
Restart takes effect. If you do not want to restart, enter the command line
Setenforce 0
Press enter, OK
Here modify reference: http://www.xiaojb.com/archives/tips/disabled-selinux.shtml
Finally, the connection is successful !!!