improve and simplifying quotes excape
Created by: vinsgithub
fixing quote excape. As a test case (in a docker compose) you can try this one
version: '3'
services:
mydb:
image: mysql:8.0.13
environment:
- MYSQL_USER=user
- MYSQL_PASSWORD=secret
- MYSQL_ROOT_PASSWORD=password
entrypoint:
sh -c "
echo 'CREATE DATABASE IF NOT EXISTS mydb; GRANT ALL PRIVILEGES ON mydb.* TO §uer§@§%§; ' > /docker-entrypoint-initdb.d/init.sql;
sed -i 's/§/\\d39/g' /docker-entrypoint-initdb.d/init.sql;
/usr/local/bin/docker-entrypoint.sh --character-set-server=utf8 --collation-server=utf8_unicode_ci --default-authentication-plugin=mysql_native_password
"
volumes:
- mydb:/var/lib/mysql
ports:
- "3307:3306"