Connecting Remotely to Heroku ClearDB Database via MySQL Query Browser
To establish a secure connection to a ClearDB MySQL database hosted on Heroku, you'll require the database's URL, port, login, and password. Here's how to obtain these details:
-
Login to Heroku Dashboard: Navigate to the Heroku website, log in to your account, and access the "My Apps" page.
-
Select Your Application: From the list of apps, choose the one where ClearDB is installed.
-
Access Addons: Click on "Addons" in the top-right corner of the app page.
-
Locate ClearDB MySQL Database: Under the Addons section, select "ClearDB MySQL Database."
-
Open Database Details: Click on your database name and switch to the "Endpoint Information" tab.
-
Obtain Username and Password: Here, you will find your database username and password.
-
Get Database URL: Open a command prompt or terminal and run the following command:
heroku config --app <YOUR-APP-NAME>
Copy after login
Replace with the name of your Heroku application.
-
Extract Database Port: From the command output, copy the portion that begins with "mysql://" and ends with "/DATABASE." This is your database URL.
-
Identify Database Host: Within the URL, locate the part that begins with "us-cdbr-east." This is your database host.
Now that you have the necessary information, you can connect to your ClearDB MySQL database remotely using MySQL Query Browser or another preferred tool.
The above is the detailed content of How to Connect to a Heroku ClearDB Database Using MySQL Query Browser?. For more information, please follow other related articles on the PHP Chinese website!