version: '3.7' services: mariadb: image: mariadb restart: always volumes: - /data/mysql:/var/lib/mysql environment: MYSQL_DATABASE: 01factory MYSQL_USER: 01factory MYSQL_PASSWORD: 01factory MYSQL_ROOT_PASSWORD: 01factory ports: - 3306:3306 adminer: image: adminer:latest restart: always ports: - 8080:8080 links: - mariadb:db
version: '3.7' services: mysql: image: mysql command: --default-authentication-plugin=mysql_native_password restart: always volumes: - /data/mysql:/var/lib/mysql environment: MYSQL_DATABASE: 01factory MYSQL_USER: 01factory MYSQL_PASSWORD: 01factory MYSQL_ROOT_PASSWORD: 01factory ports: - 3306:3306 adminer: image: adminer:latest restart: always ports: - 8080:8080 links: - mysql:db
sudo docker-compose up -d
sudo docker-compose start
sudo docker-compose stop
sudo docker stop mysql adminer
{ "dbconfig": { "client": "mysql2", "connection": "mysql://01factory:01factory@127.0.0.1:3306/01factory", "pool": { "min": 0, "max": 7 } } }
或
{ "dbconfig": { "client": "mysql", "connection": "postgres://01factory:01factory@127.0.0.1:3306/01factory", "pool": { "min": 0, "max": 7 } } }