我已经使用docker创建了mysql容器,但是它不符合设置的密码。
root@5b4f1a35c7b8:/# mysql -uroot -ppassword
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
dockerfile中的代码
mysql:
build: ./bin/mysql
container_name: 'png-mysql'
restart: 'always'
ports:
- "3306:3306"
volumes:
- /var/www/docker-compose-lamp/bin/mysql/db:/docker-entrypoint-initdb.d
- ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql
- ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: x_muti_site
MYSQL_USER: root
MYSQL_PASSWORD: password