mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-11 04:15:36 +03:00
docs(mysql): init (#157)
This commit is contained in:
parent
fd961ce2aa
commit
f8110887f1
46
doc/mysql.md
46
doc/mysql.md
@ -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; }];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user