duanmu3049 2019-08-06 08:04
浏览 122

从外部域连接在线数据库

I'm setting up a remote access to external database (from another domain),

I tried to whitelist the IP address of the second domain in the first cpanel domain

$db1 = new PDO('mysql:host=ip1;dbname=database1','user1','password1', array(PDO::MYSQL_ATTR_INIT_COMMAND =>  "SET NAMES 'UTF8'")); 
$db2= new PDO('mysql:host=ip2;dbname=database2','user2','password2', array(PDO::MYSQL_ATTR_INIT_COMMAND =>  "SET NAMES 'UTF8'")); 

I except to connect the external database (database1) from the domaine 2 But I get this error :

Access denied for user "user2@'ip_domaine2'(using password: YES)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?