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 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分