From 071821a874293d7413c03a0fa6aa4081b1a97013 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Thu, 21 Mar 2024 14:40:16 +0530 Subject: [PATCH 1/2] docs(mysql): init --- doc/mysql.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/doc/mysql.md b/doc/mysql.md index 00a438d8..0750aae9 100644 --- a/doc/mysql.md +++ b/doc/mysql.md @@ -1,6 +1,38 @@ # MySQL ->[!warning] 🚧 WIP +[MySQL](https://github.com/mysql/mysql-server) is a popular open-source relational database management system (RDBMS). -Usage example: - +## Getting started + +```nix +# In `perSystem.process-compose.` +{ + services.mysql."mysql1".enable = true; +} +``` + +## Tips & Tricks + +### Use a different port + +```nix +{ + services.mysql."mysql1" = { + enable = true; + settings.mysqld.port = 3307; + }; +} +``` + +### Multiple `.sql` files for schema + +The `schema` can be a path to a single `.sql` file or a directory containing multiple `.sql` files. + +```nix +{ + services.mysql."mysql1" = { + enable = true; + initialDatabases = [{ name = "test_database"; schema = ./test_schemas; }]; + }; +} +``` From 4149975b43f39a6a3beb4bd81e0b551bc503dfe3 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Thu, 21 Mar 2024 14:46:15 +0530 Subject: [PATCH 2/2] docs: add heading anchors --- doc/mysql.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/mysql.md b/doc/mysql.md index 0750aae9..cbcd9785 100644 --- a/doc/mysql.md +++ b/doc/mysql.md @@ -2,6 +2,8 @@ [MySQL](https://github.com/mysql/mysql-server) is a popular open-source relational database management system (RDBMS). +{#start} + ## Getting started ```nix @@ -11,8 +13,12 @@ } ``` +{#tips} + ## Tips & Tricks +{#port} + ### Use a different port ```nix @@ -24,6 +30,8 @@ } ``` +{#schema} + ### Multiple `.sql` files for schema The `schema` can be a path to a single `.sql` file or a directory containing multiple `.sql` files.