douzhe9075 2019-08-12 08:36
浏览 66
已采纳

如何通过Alwaysdata获取数据库主机的IP地址? [关闭]

----- EDIT ---------------------------------

The reason of this edit is that my first post was not pointing out the right issue. The new post below should be more accurate.

I am using Laravel so I have to know the ip address of my database, which is host by Alwaysdata.

How can I find the ip address of my database?

I already searched how to get it, but found only how to get the hostname, which can defenitly not be resolved into the database host IP.

----- OLD POST ---------------------------------

Title: How to use a non local MySQL database with Laravel?

I am making a website using Laravel and now need to use a database. I want to use Laravel migrations to manage the database. So I tried to run the command php artisan migrate:install but got an error telling me that database access has been denied.

My database is a MySQL database. I use online phpmyadmin (actually I am using alwaysdata which uses phpmyadmin for databases).

Here is my database config in the Laravel .env file:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_database
DB_USERNAME=my_username
DB_PASSWORD=***********

I am sure about the database name, as well as my username and password. The database port should be right as I checked it, but I can't find the host of my database.

I already searched how to get it, but found only how to get the hostname, which can defenitly not be resolved into the database host IP.

Does anyone know how to use Laravel along with an externally-hosted MySQL database?

  • 写回答

1条回答 默认 最新

  • dongsicheng5262 2019-08-12 08:51
    关注

    If your using alwaysdata, then if you go to Databases > MySQL, you'll see a banner on top with the host you're supposed to use:

    banner

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端