Browse Source

use optional slow_query_log

master
Markus Bergholz 3 years ago
parent
commit
2453571e0d
2 changed files with 11 additions and 1 deletions
  1. +5
    -0
      docker/mariadb/alpine/README.md
  2. +6
    -1
      docker/mariadb/alpine/start.sh

+ 5
- 0
docker/mariadb/alpine/README.md View File

@ -10,3 +10,8 @@ Init with
docker exec -ti mariadb mysql -h 127.1 -e "create user 'm'@'%' identified by 'nomysql1';"
docker exec -ti mariadb mysql -h 127.1 -e "grant all privileges on *.* to 'm'@'%' with grant option;"
```
# option
to enable slow_query_log, use `-e SLOW_LOG=true`.
Log location is `/var/lib/mysql/slow_query.log`.

+ 6
- 1
docker/mariadb/alpine/start.sh View File

@ -8,4 +8,9 @@ then
mysql_install_db --user=mysql --datadir=/var/lib/mysql
fi
echo "start mariadb"
mysqld_safe
if [ -z ${SLOW_LOG+x} ]; then
mysqld_safe
else
mysqld_safe --slow-query-log --slow-query-log-file=/var/lib/mysql/slow_query.log
fi

Loading…
Cancel
Save