时间:2021-07-01 10:21:17 帮助过:16人阅读
1. Start a mysql container:
$docker run -p 3306:3306 --name mysql-server-1 -e MYSQL_ROOT_PASSWORD=welcome1 -v /scratch/cdctest/work/data/:/var/lib/mysql -d mysql
note: /scratch/cdctest/work/data/, the directory in docker host, used for data persistence.
2. Initialize mysql database:
$mysql -u root -p
Create a user named with cdctest
mysql> CREATE USER cdctest IDENTIFIED BY ‘MyTest1@‘;
mysql> grant all privileges on *.* to cdctest@"%" with grant option;
mysql> flush privileges;
$mysql -u cdctest -p
mysql docker usage
标签:scratch cto word strong enc com director password persist