如何连接到数据库中的另一个服务器上 [英] how to connect to database on another server

查看:371
本文介绍了如何连接到数据库中的另一个服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以对服务器A上我的PHP脚本,并连接到MySQL数据库服务器B上?

Could I have my php scripts on server A and connect to the MySQL database on server B?

如果是,它将如何做?在此先感谢

If yes, how it would be done? Thanks in advance

推荐答案

其简单的全thise上述技术是相当复杂的。

its simple all thise above techniques are quite complicated

假设你有服务器B和网站服务器A上的数据库(说它IP 192.234.12.1)

suppose you have database on server B and website on server A(say it has IP 192.234.12.1)

上的cPanel白名单服务器B的IP

on cpanel whitelist the IP of server B

和创建数据库具有足够权限的新用户(比如这个用户测试)

and create a new user having sufficient privileges in database (say this user is test)

然后建立这个用户为test@192.234.12.1

then create this user as test@192.234.12.1

这篇关于如何连接到数据库中的另一个服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆