Script tested on Rocky Linux 8.9 and mysql 8.0.36
export MYSQL_VERSION="8.0.36" dnf install git cmake3 gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils gcc-toolset-12-annobin-annocheck gcc-toolset-12-annobin-plugin-gcc elfutils openssl-devel ncurses-devel libtirpc-devel patch automake libtool mysql-devel libudev-devel bison curl-devel python2 -y dnf -y --enablerepo=powertools install rpcgen scl enable gcc-toolset-12 bash wget -q -N https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-boost-${MYSQL_VERSION}.tar.gz -O mysql-boost-${MYSQL_VERSION}.tar.gz git clone https://github.com/trellix-enterprise/mysql-audit.git cd mysql-audit git checkout tags/v1.1.13 tar zxvf ../mysql-boost-${MYSQL_VERSION}.tar.gz cd mysql-${MYSQL_VERSION}
cmake3 -DFORCE_INSOURCE_BUILD=ON -DWITH_BOOST=boost .
make -j`nproc --all` -C libservicesmake -j`nproc --all` -C include
cd .. perl -pi -e 's/TABLE_LIST/Table_ref/g' `grep -rlw TABLE_LIST include/ src/ offset-extract/` cd src
patch --verbose --ignore-whitespace audit_handler.cc << EOF
--- audit_handler.cc 2024-01-24 17:19:37.247677405 +0000
+++ audit_handler.cc.2 2024-01-24 17:23:21.295862210 +0000
@@ -841,7 +841,7 @@
const char *well_formed_error_pos = NULL, *cannot_convert_error_pos = NULL,
*from_end_pos = NULL;
copy_length = well_formed_copy_nchars(
- &my_charset_utf8_bin
+ &my_charset_utf8mb4_bin
, dest
, dest_size
, from_cs
@@ -1089,7 +1089,7 @@
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100504
&my_charset_utf8mb3_general_ci,
#else
- &my_charset_utf8_general_ci,
+ &my_charset_utf8mb4_general_ci,
#endif
query, qlen,
col_connection, & errors);
EOF
cd ..
chmod +x bootstrap.sh ./bootstrap.sh CXX='gcc -static-libgcc' CC='gcc -static-libgcc' ./configure --with-mysql=mysql-${MYSQL_VERSION} --with-mysql-libservices=mysql-${MYSQL_VERSION}/libservices/libmysqlservices.a perl -pi -e 's/automake-1.15/automake/g' pcre/Makefile perl -pi -e 's/aclocal-1.15/aclocal/g' pcre/Makefile
alternatives --config pythonmake -j`nproc --all`
ls -la src/.libs
and finally: cp src/.libs/libaudit_plugin.so* /usr/lib64/mysql/plugin/
Issue and discussion:
https://github.com/trellix-enterprise/mysql-audit/issues/261
One more mention:
mysqldump <db_name> <table_name> --where="extension_id=727" > outfile.sql
version: '3.9'
services:
redmine:
image: redmine:5.0
restart: always
depends_on:
- mysql-redmine
ports:
- 8090:3000
volumes:
- /srv/redmine-files:/usr/src/redmine/files
- /srv/redmine-logs:/var/log/redmine
environment:
- TZ=Europe/Kyiv
- REDMINE_DB_MYSQL=mysql-redmine
# - REDMINE_DB_USER=redmine
# - REDMINE_DB_PASSWORD=somepassword
- REDMINE_DB_PASSWORD=supermegapassword
- REDMINE_SECRET_KEY_BASE=supersecretkey
networks:
redmine:
mysql-redmine:
image: mysql:8.0
restart: always
environment:
- MYSQL_ROOT_PASSWORD=supermegapassword
- MYSQL_DATABASE=redmine
- MYSQL_USER=redmine
- MYSQL_PASSWORD=somepassword
networks:
redmine:
networks:
redmine:
driver: bridge
services:
dind:
image: docker:23-dind
restart: always
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
command:
- --storage-driver=overlay2
runner:
restart: always
image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
depends_on:
- dind
environment:
- DOCKER_HOST=tcp://dind:2375
volumes:
- ./config:/etc/gitlab-runner:z
# register-runner:
# restart: 'no'
# image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
# depends_on:
# - dind
# environment:
# - CI_SERVER_URL=${CI_SERVER_URL}
# - REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
# command:
# - register
# - --non-interactive
# - --locked=false
# - --name=${RUNNER_NAME}
# - --executor=docker
# - --docker-image=docker:20-dind
# - --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
# volumes:
# - ./config:/etc/gitlab-runner:z