Hi, for anybody who is interested, here is my step by step.
In fact, Plesk should find a way to automate this task to release us from this agony ;-)
Plesk Onyx 17.8.11; Ubuntu 16.04.5 LTS; MySQL 5.7.24
Create second MySQL - Database - Instance:
--> cp -prvf /etc/mysql/ /etc/mysql2
--> mkdir -p /var/lib/mysql2
--> chown --reference /var/lib/mysql /var/lib/mysql2
--> chmod --reference /var/lib/mysql /var/lib/mysql2
--> mkdir -p /var/log/mysql2
--> chown --reference /var/log/mysql /var/log/mysql2
--> chmod --reference /var/log/mysql /var/log/mysql2
--> Create error log file:
--> vi /var/log/mysql2/error.log
--> chown mysql /var/log/mysql2/error.log
--> edit mysqld.cnf and my.cnf File:
vi /etc/mysql2/mysql.conf.d/mysqld.cnf
[client]
port = 3337
socket = /var/run/mysqld/mysqld2.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld2.sock
[mysqld]
pid-file = /var/run/mysqld/mysqld2.pid
socket = /var/run/mysqld/mysqld2.sock
port = 3337
datadir = /var/lib/mysql2
log_error = /var/log/mysql2/error.log
#skip_name_resolve
!includedir /etc/mysql2/conf.d/
vi /etc/mysql2/my.cnf
!includedir /etc/mysql2/conf.d/
!includedir /etc/mysql2/mysql.conf.d/
--> edit /etc/mysql2/debian.cnf file
In section [client]:
--> socket = /var/run/mysqld/mysqld2.sock
In section [mysql_upgrade]:
--> socket = /var/run/mysqld/mysqld2.sock
--> add content to apparmor file:
--> vi /etc/apparmor.d/usr.sbin.mysqld
### Pasted this content --### secondary aka mysql2 ##
/etc/mysql2/*.pem r,
/etc/mysql2/conf.d/ r,
/etc/mysql2/conf.d/* r,
/etc/mysql2/*.cnf r,
/var/lib/mysql2/ r,
/var/lib/mysql2/** rwk,
/var/log/mysql2/ r,
/var/log/mysql2/* rw,
/{,var/}run/mysqld/mysqld2.pid w,
/{,var/}run/mysqld/mysqld2.sock w,
#################### End of configuration for mysql2 ######################
--> restart apparmor: /etc/init.d/apparmor restart
--> mysqld --initialize --user=mysql --datadir=/var/lib/mysql2
--> sed -i 's/key_buffer/key_buffer_size/' /etc/mysql2/my.cnf
--> Start mysql server:
--> mysqld_safe --defaults-file=/etc/mysql2/my.cnf &
--> Check if Server is running on Port 3337
--> netstat -tanp|grep mysql
--> if not, check error.log: vi /var/log/mysql2/error.log
--> Setting root password:
--> find processid: ps -aef | grep mysql2
--> kill <processid>
--> Create file including Set-Password-Statement:
--> vi /var/lib/mysql2/rootpw
--> Statement: ALTER USER 'root'@'localhost' IDENTIFIED BY '<root-password>';
--> chown mysql rootpw
--> Start mysql:
--> mysqld_safe --defaults-file=/etc/mysql2/my.cnf --init-file=/var/lib/mysql2/rootpw &
--> Check Connection to database:
--> mysql --user=root --host=127.0.0.1 --port=3337 --password
--> IMPORTANT: DELETE rootpw File
--> rm /var/lib/mysql2/rootpw
--> Stop mysql:
--> mysqladmin -S /var/run/mysqld/mysqld2.sock shutdown -p
--> Configure as Service:
--> Create service file:
--> vi /etc/systemd/system/mysql2.service
[Unit]
Description=Second mysql database
[Service]
ExecStart=/bin/bash -c "nohup mysqld_safe --defaults-file=/etc/mysql2/my.cnf &"
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
--> systemctl daemon-reload
--> systemctl enable mysql2.service
--> service mysql2 start
--> service mysql2 status
--> service mysql2 stop
--> service mysql2 start
--> Configure second mysql Server in Plesk
--> Tools&Settings --> DB Server --> Add DB Server
--> Hostname: 127.0.0.1
--> Port: 3337
--> Type: MySQL
--> Credentials for root user
--> OK
--> phpMyAdmin should point correctly now. Make shure that #skip_name_resolve is commented out in my.cnf