docs(mysql): init (#157)

This commit is contained in:
Shivaraj B H 2024-03-21 15:04:28 +05:30 committed by GitHub
parent fd961ce2aa
commit f8110887f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,46 @@
# MySQL
>[!warning] 🚧 WIP
[MySQL](https://github.com/mysql/mysql-server) is a popular open-source relational database management system (RDBMS).
Usage example:
<https://github.com/juspay/services-flake/blob/main/nix/mysql/mysql_test.nix>
{#start}
## Getting started
```nix
# In `perSystem.process-compose.<name>`
{
services.mysql."mysql1".enable = true;
}
```
{#tips}
## Tips & Tricks
{#port}
### Use a different port
```nix
{
services.mysql."mysql1" = {
enable = true;
settings.mysqld.port = 3307;
};
}
```
{#schema}
### 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; }];
};
}
```