summaryrefslogtreecommitdiff
path: root/topics
diff options
context:
space:
mode:
authorPjotr Prins2023-11-09 17:18:38 +0100
committerPjotr Prins2023-11-09 17:18:38 +0100
commite2c22b1a89835f45576d074d9746c79c7e1df52c (patch)
treea22ae8aa902ce30ca52cd8751d5843bac8796f26 /topics
parent964c743be7f0876fc7407731c98a8c01e326da2a (diff)
downloadgn-gemtext-e2c22b1a89835f45576d074d9746c79c7e1df52c.tar.gz
Info on ssh tunnels for mariadb etc.
Diffstat (limited to 'topics')
-rw-r--r--topics/setting-up-local-development-database.gmi26
1 files changed, 26 insertions, 0 deletions
diff --git a/topics/setting-up-local-development-database.gmi b/topics/setting-up-local-development-database.gmi
index a14cb41..f7d6f55 100644
--- a/topics/setting-up-local-development-database.gmi
+++ b/topics/setting-up-local-development-database.gmi
@@ -2,6 +2,32 @@
You need to set up a quick local database for development without polluting your environment.
+## Method 0 (tunnel)
+
+You can use ssh tunneling to access mysql from your machine. Try something like:
+
+```
+ssh -L 3306:127.0.0.1:3306 -f -N tux02.genenetwork.org
+mysql -uwebqtlout -pwebqtlout -h 127.0.0.1 db_webqtl -A -e "show tables;"
+```
+
+To keep the connection alive add something like this to your `~/.ssh/config`
+
+```
+ServerAliveInterval 60
+ServerAliveCountMax 10
+```
+
+For specific hosts you can set it up as
+
+```
+Host tux02
+ HostName tux02.genenetwork.org
+ TCPKeepAlive yes
+ ServerAliveInterval 60
+ user myname
+```
+
## Method 1 (Using Guix system containers)
Setting up mariadb in a Guix container is the preferred and easier method. But, you need root access to run the container. The genenetwork2 repo comes with a guix system container definition to run MariaDB and Redis. From the genenetwork2 repo, you can build and run the container using: