Home > Database > Mysql Tutorial > How do I connect to my Heroku ClearDB MySQL database remotely?

How do I connect to my Heroku ClearDB MySQL database remotely?

Mary-Kate Olsen
Release: 2024-10-29 12:00:29
Original
1019 people have browsed it

How do I connect to my Heroku ClearDB MySQL database remotely?

Accessing Heroku ClearDB MySQL Database Remotely

To establish a remote connection to a ClearDB MySQL database hosted on Heroku, the following steps provide a guided approach:

  1. Locate Endpoint Information on Heroku Website:
  • Navigate to the Heroku website and select "My Apps."
  • Select the application where ClearDB is installed.
  • Under "Addons," choose "ClearDB MySQL Database."
  • Select your database and open the "Endpoint Information" tab.
  1. Retrieve Credentials from Heroku:
  • Within the "Endpoint Information" tab, you will find your username and password.
  1. Obtain Database URL from Heroku Command Line:
  • Open a command prompt and enter the following command:

    • heroku config --app
  • Replace with the actual name of your Heroku application.
  1. Extract Hostname from Database URL:
  • The command output will display the database URL. Locate the section within the URL that resembles:

    • mysql://user:pass@**hostname**/**DATABASE?reconnect=true
  • The hostname component (e.g., us-cdbr-east.cleardb.com in the provided example) represents the database host.
  1. Remote Connection with MySQL Query Browser:
  • Initiate MySQL Query Browser.
  • Enter the following information:

    • Host: The hostname obtained from Heroku's Endpoint Information tab.
    • Port: 3306 (default MySQL port)
    • Username: The username from Heroku's Endpoint Information tab
    • Password: The password from Heroku's Endpoint Information tab
    • Database: The name of the database you wish to connect to.

The above is the detailed content of How do I connect to my Heroku ClearDB MySQL database remotely?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template