Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions Databases/mysql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
52 changes: 52 additions & 0 deletions Databases/mysql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# MYSQL

Documentação do MySQL

[https://dev.mysql.com/doc/](https://dev.mysql.com/doc/)

Docker Image

[mysql](https://hub.docker.com/_/mysql)

[quay.io/prometheus/mysqld-exporter](https://quay.io/repository/prometheus/mysqld-exporter?tab=info)

## Usage

Crie o arquivo .env.

```bash
cp .env.example .env
```

```dotenv
MYSQL_ROOT_PASSWORD=

MYSQL_EXPORTER_USER=exporter
MYSQL_EXPORTER_PASSWORD=
```

Crie o arquivo conf/init.sql

```bash
cp conf/init.sql.example conf/init.sql
```

Lembre de ajustar a senha igual ao do arquivo .env.

## Comands

```bash
docker compose build
```

```bash
docker compose up -d
```

```bash
docker compose down
```

```bash
docker compose rm
```
2 changes: 2 additions & 0 deletions Databases/mysql/conf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
init.sql
!.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ collation-server=utf8mb4_unicode_ci
slow_query_log=1
long_query_time=1
log_output=FILE
max_connections=200
max_connections=400
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CREATE USER IF NOT EXISTS 'exporter'@'%' IDENTIFIED BY 'youpassworduserexporter';
CREATE USER IF NOT EXISTS 'exporter'@'%' IDENTIFIED BY 'MYSQL_EXPORTER_PASSWORD';
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'%';
FLUSH PRIVILEGES;