2022년 5월 16일 월요일

docker mysql 설치

docker pull mysql

docker images

docker run --name mysql-container -e MYSQL_ROOT_PASSWORD=abcd -d -p 3306:3306 mysql:latest

docker ps

docker exec -it mysql-container bash


mysql -u root -p

mysql> create database tutorial;

mysql> create user [id]@'%' identified by 'abcd';

mysql> create user [id]@localhost identified by 'abcd';

mysql> grant all privileges on tutorial.* to [id]@'%';

mysql> grant all privileges on tutorial.* to [id]@localhost;

mysql> alter user thlee@'%' identified with mysql_native_password by 'abcd';

mysql> grant all privileges on tutorial.& to [id]@172.17.0.1 with grant option;


allowPublicKeyRetrival=true




select @@datadir;


docker volume

$ docker volume create my-vol

my-vol

$ docker volume ls

DRIVER    VOLUME NAME

local     my-vol

$ docker volume inspect my-vol

[

    {

        "CreatedAt": "2022-05-11T12:02:14Z",

        "Driver": "local",

        "Labels": {},

        "Mountpoint": "/var/lib/docker/volumes/my-vol/_data",

        "Name": "my-vol",

        "Options": {},

        "Scope": "local"

    }

]


[python] subprocess

proc.py import asyncio from argparse import ArgumentParser from asyncio import sleep async def process_function(user, file_path):     if use...