summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-09-06 19:42:15 +0530
committerArun Isaac2022-09-06 19:42:15 +0530
commitfd47102b5e2fdae1f8c05ac18c2bdafaa8225df8 (patch)
treeb4f404ddaf0220df8d1c131d1e26558d1b6754a3
parent6c82d26247de360ad1a276cb77c41b6bbae51e9e (diff)
downloadgn-gemtext-fd47102b5e2fdae1f8c05ac18c2bdafaa8225df8.tar.gz
Add Guix method to set up local development database.
-rw-r--r--topics/setting-up-local-development-database.gmi29
1 files changed, 25 insertions, 4 deletions
diff --git a/topics/setting-up-local-development-database.gmi b/topics/setting-up-local-development-database.gmi
index a6fdb5e..13946e7 100644
--- a/topics/setting-up-local-development-database.gmi
+++ b/topics/setting-up-local-development-database.gmi
@@ -1,14 +1,35 @@
# Setting up Local Development Database
-## Introduction
+You need to set up a quick local database for development without polluting your environment.
-You need to set up a quick local database for development without needing root permissions and polluting your environment.
+## Method 1 (Using Guix)
+
+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:
+```
+$ sudo $(./containers/db-container.sh)
+```
+You should now be able to connect to the database using
+```
+$ mysql --protocol tcp -u root
+```
+Create a database db_webqtl_s
+```
+MariaDB [mysql]> CREATE DATABASE db_webqtl_s;
+```
+Load the small database dump into the database. You may find the small database on tux02 at /home/aruni/gn2.sql.lz
+```
+$ lzip -cd gn2.sql.lz | mysql --protocol tcp -u root db_webqtl_s
+```
+Since this is a develpoment server accessible only from localhost, it is ok to use the root user with no password. Configure your development instance of genenetwork2 with the following SQL_URI.
+```
+SQL_URI="mysql://root@127.0.0.1:3306/db_webqtl_s"
+```
+
+## Method 2 (Manual method without Guix)
* An assumption is made that the GeneNetwork2 profile is in ~/opt/gn_profiles/gn2_latest for the purposes of this documentation. Please replace as appropriate.
* We install the database files under ~/genenetwork/mariadb. Change as appropriate.
-## Set up Database Server
-
Set up directories
```