• 0 342 317 1951 - 1952

Ubuntu 20 üzerinde docker ve docker üzerinde MySQL kurulumu 

apt-get update 

apt-get upgrade

apt install docker.io

docker -v

Docker version 19.03.8, build afacb8b7f0

systemctl enable --now docker

sudo systemctl status docker

sudo docker ps

usermod -aG docker celal

docker run hello-world

docker pull mysql/mysql-server:latest

docker run --name=GAUN_MySQL -d mysql/mysql-server:latest

docker logs  GAUN_MySQL | grep GENERATED ile üretilen şifreyi al.

docker exec -it GAUN_MySQL mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yenisifre';
mysql> flush privileges
mkdir -p /root/docker/GAUN_MySQL/conf.d
pico /root/docker/GAUN_MySQL/conf.d/my-custom.cnf
[mysqld]
max_connections=250

 

docker run \
--detach \
--name=[container_name]\
--env="MYSQL_ROOT_PASSWORD=[my_password]" \
--publish 6603:3306 \
--volume=/root/docker/[container_name]/conf.d:/etc/mysql/conf.d mysql