diff --git a/Databases/mysql/.env b/Databases/mysql/.env.example similarity index 100% rename from Databases/mysql/.env rename to Databases/mysql/.env.example diff --git a/Databases/mysql/.gitignore b/Databases/mysql/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/Databases/mysql/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/Databases/mysql/README.md b/Databases/mysql/README.md new file mode 100644 index 0000000..44a58af --- /dev/null +++ b/Databases/mysql/README.md @@ -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 +``` \ No newline at end of file diff --git a/Databases/mysql/conf/.gitignore b/Databases/mysql/conf/.gitignore new file mode 100644 index 0000000..ea5ff72 --- /dev/null +++ b/Databases/mysql/conf/.gitignore @@ -0,0 +1,2 @@ +init.sql +!.gitignore \ No newline at end of file diff --git a/Databases/mysql/conf/my.cnf b/Databases/mysql/conf/conf-my.cnf similarity index 91% rename from Databases/mysql/conf/my.cnf rename to Databases/mysql/conf/conf-my.cnf index 8d27979..c210cb7 100644 --- a/Databases/mysql/conf/my.cnf +++ b/Databases/mysql/conf/conf-my.cnf @@ -6,4 +6,4 @@ collation-server=utf8mb4_unicode_ci slow_query_log=1 long_query_time=1 log_output=FILE -max_connections=200 \ No newline at end of file +max_connections=400 \ No newline at end of file diff --git a/Databases/mysql/conf/init.sql b/Databases/mysql/conf/init.sql.example similarity index 50% rename from Databases/mysql/conf/init.sql rename to Databases/mysql/conf/init.sql.example index d39f855..3854301 100644 --- a/Databases/mysql/conf/init.sql +++ b/Databases/mysql/conf/init.sql.example @@ -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; \ No newline at end of file