search

Home  >  Q&A  >  body text

Connect dokku MySQL using a database GUI such as Sequel Ace or Sequel Pro

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

I have created a database and linked it to my (Laravel) application and it works great! But I don't know which username/password/host I need to fill in in sequel ace to connect to the database inside dokku.

Does anyone have experience in this area?

Thanks in advance!

P粉792673958P粉792673958236 days ago441

reply all(1)I'll reply

  • P粉309989673

    P粉3099896732024-03-28 14:32:00

    Figured out.

    1. Expose your mysql database to port dokku mysql:expose <db_name> <port>
    2. Run dokku mysql:info <db_name> Find "Dsn" (DATABASE_URL). It looks like mysql://mysql:@dokku-mysql-staging-db:3306/
    3. This URL contains all the information you need [Database type]://{username}:{password}@{internal docker host name}/{db_name}
    4. Now you can connect remotely to the database GUI

    I successfully connected using Sequel Pro and the following information was displayed:

    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 disable UFW on the server, but I'm not in server administration so I don't know the consequences of that.

    reply
    0
  • Cancelreply