dongsu3138 2014-08-04 05:43
浏览 76
已采纳

无法连接到其他服务器上的phpmyadmin

I have a website hosting on www.host1free.com. Earlier I had connected to MySQL database of the host.

Now I am having my own VPS which is accessed by ip address 5.231.36.181. I have also installed phpmyadmin. All works fine within the server.

Now I want to connect my website database to the MySQL server on 5.231.36.181.

The database on the server is accessed by 5.231.36.181/phpmyadmin and the database on host is accessed by sql12.1freehosting.com/phpmyadmin

How to connect the database to my VPS phpmyadmin ?

  • 写回答

3条回答 默认 最新

  • doufei8691 2014-08-04 05:52
    关注

    whatever the details you are using for logging in to your phpmyadmin use the same usename and password for connecting to database

    secondly host can be localhost or your VPS IP Address

    PHP MY ADMIN Panel TOP

    The rectangle marked in red contains your IP ,

    1. Use the IP Address of the server and Username and password that you used to login if you are still not getting it post us what you have tried and what error you are getting

    connecting to mysql database

    // Define database connection constants
    define('DB_HOST', 'your IP');
    define('DB_USER', 'Your DB USER');
    define('DB_PASSWORD', 'db user Password');
    define('DB_NAME', 'your dbname');
    
    $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) 
    or die('cannot connect to   MYSQL');
    

    if you are confused you can create a new database user assign the database to the particular user and can use the details to connect to your DB Cheers

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看