我有两个服务器,分别是 abc.com
和 xyz.com
。在 abc.com
上,我创建了一个数据库。我想访问 xyz.com
中的这个数据库。
我在 abc.com
上创建了远程主机 123.123.123.123
。但是不知道下一步。
提前致谢
最佳答案
我认为您应该首先阅读有关为您的 cPanel/WHM 服务器配置远程 mysql 服务器的 cPanel/WHM 文档: https://documentation.cpanel.net/display/ALD/Remote+MySQL
As a basic guideline the steps would be as follow:
- create a mysql database in a cPanel's user account
- create a mysql username and password for that database
- grant rights to that user for that database
- add the ip address of the mysql remote host you want to use
- check your server firewall and be sure that you grant access to mysql (tcp port 3306) to that ip address;
- from the remote host try doing a **telnet cpanel-server-ip 3306** and see if you can connect
关于php - 在一台服务器上创建Mysql主机并从另一台服务器访问数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47039662/