Installare Percona MySQL 8 su LXD

Installa LXD su Ubuntu 18.04 LTS

sh -c 'apt update && apt upgrade'
apt install lxd
apt install zfsutils-linux
lxd init

Crea un container LXC e installa Percona MySQL

lxc launch images:ubuntu/xenial/amd64 percona-mysql8
lxc exec percona-mysql8 bash
apt install wget
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
percona-release setup ps80
sh -c 'apt update && apt upgrade'
percona-release setup ps80
sh -c 'apt update && apt upgrade'
apt-get install percona-server-server

Crea l’utente e database MySQL

mysql -u root -p
CREATE USER 'nome_db'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nome_db.* TO 'nome_db'@'%';
CREATE DATABASE nome_db;
SHOW DATABASES;

ALTER USER 'nome_db'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
lxc config device add percona-mysql8 mysql3306 proxy listen=tcp:0.0.0.0:3306 connect=tcp:localhost:3306
lxc config device remove percona-mysql8 mysql3306

lsof -i -n

Related Posts