Back

DataGrip connection to MariaDB gives Timeout

  • 0
  • Self Hosted
  • Tools
Krinnen
24 Jun, 2024, 19:22

I want to use DataGrip to get more control over my data inside my database, and I have tried to SSH tunneling as described in: https://discord.com/channels/564160730845151244/1087377262640365728/1087399578401263677, but I can't get it to work. It keeps giving me the error SSH: Connection timed out: connect.. I have included the options inside the screenshots.

TL;DR
Developers faced timeout issues when connecting DataGrip to MariaDB. Adding port 3306 and changing connection to 'localhost' in the `docker-compose.yml` file resolved the problem. Ensure to enter the correct IP address in the main screen and when testing the SSH connection.
Binyamin
24 Jun, 2024, 19:23

When clicking on test ssh connection What you get?

Binyamin
24 Jun, 2024, 19:23

The IP should be of the server

Krinnen
24 Jun, 2024, 19:24

The IP address of the SSH tunnel is the ip address I get when I run the docker network inspect.

Binyamin
24 Jun, 2024, 19:24

So this IP should be in the main screen

Krinnen
24 Jun, 2024, 19:24
Binyamin
24 Jun, 2024, 19:25

Here you need to enter your server public IP

Binyamin
24 Jun, 2024, 19:25

Here you should enter the 172.18.0.4 IP

Krinnen
24 Jun, 2024, 19:26

Alright, now it gives me this error:

Binyamin
24 Jun, 2024, 19:26

Is your server IP is localhost? Is this a local instance or remote one?

Krinnen
24 Jun, 2024, 19:27

I want to access my local instance indeed.

Binyamin
24 Jun, 2024, 19:27

Local, as in your local machine? If so do this

Binyamin
24 Jun, 2024, 19:28

Add these lines in your docker-compose.yml file

TypeScript
  mariadb:
    image: mariadb:10.11 # fix issues when upgrading using: mysql_upgrade -u root -p
    container_name: appwrite-mariadb
    <<: *x-logging
    restart: unless-stopped
    networks:
      - appwrite
    volumes:
      - appwrite-mariadb:/var/lib/mysql:rw
+   ports:
+    - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=${_APP_DB_ROOT_PASS}
      - MYSQL_DATABASE=${_APP_DB_SCHEMA}
      - MYSQL_USER=${_APP_DB_USER}
      - MYSQL_PASSWORD=${_APP_DB_PASS}
      - MARIADB_AUTO_UPGRADE=1
    command: 'mysqld --innodb-flush-method=fsync'

Then, run

TypeScript
docker compose up -d

Then, change the connection to localhost, remove the SSH tunnel and you're set to go

Krinnen
24 Jun, 2024, 19:31

Yes, it works now. Thanks for the help!

Binyamin
24 Jun, 2024, 19:32

:appwritefire:

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more