Connecting dokku MySQL to a database GUI (e.g. Sequel Ace or Sequel pro)

523 Views Asked by At

I have a dokku installation with MySQL. I'm trying to figure out how I can connect my MySQL database in dokku to a database GUI like Sequel ace or Sequel pro.

I already made a database and linked it to my (Laravel) app, which works fine! But I can't figure out which username / password / host I need to fill in, in sequel ace to connect to the database inside dokku.

Does anyone have any experience with this?

Thanks in advance!

1

There are 1 best solutions below

0
Cornelius van Erkelens On

Figured it out.

  1. expose your mysql db to a port dokku mysql:expose <db_name> <port>
  2. run dokku mysql:info <db_name> en look for the "Dsn" (DATABASE_URL). It looks something like mysql://mysql:<random_code>@dokku-mysql-staging-db:3306/<db_name>
  3. This URL has al the info you need [database type]://{username}:{password}@{inner docker host name}/{db_name}
  4. Now you kan connect remotly with your DB GUI

I connected succesfully using Sequel Pro with the following info:

Host: { your servers IP address }

Username: { username from DB URL }

Password: { password from DB URL }

Port: { port you exposed the DB on }

PS: i read somewhere that you need to have UFW disable on your server, but i'm not in server managment, so i don't know the consequence of this.