简体   繁体   中英

Connection to database remotely from a server to another differently server

I have webhost from ABC Incorporate.

I bought a mysql database from XYZ Incorporate.

When I try to acces via PHP, the MySQL server from XYZ Incorporate, using the ABC Incorporate's server, it gives me this error:

connection refused in

I tried to talk with those two incorporates, and they said that.

No IP restriction was given, so I could've easly connect. My question is, why is connecting?

My config.php

<?php

DEFINE ('DB_USER', 'yes');
DEFINE ('DB_PASSWD', 'somepassword');
DEFINE ('DB_HOST', 'IPv4');
DEFINE ('DB_NAME', 'dbname');

$con = mysqli_connect(DB_HOST, DB_USER, DB_PASSWD, DB_NAME);

if(!$con){
    die('Database connection error');
}
?> 

允许数据库主机远程连接。它将可以访问。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM