我正在Mac上使用Docker构建一个简单的LEMP堆栈。
这是我的docker-compose文件:
nginx:
image: tutum/nginx
ports:
- "3333:80"
links:
- phpfpm
- db
volumes:
- ./nginx/default.conf:/etc/nginx/sites-available/default
- ./nginx/default.conf:/etc/nginx/sites-enabled/default
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
phpfpm:
build: ./phpfpm
ports:
- "9000:9000"
volumes:
- ./code:/usr/share/nginx/html
db:
image: mysql
tty: true
restart: always
volumes:
- /Users/mauo/local/mysql/data:/var/lib/mysql
ports:
- "3308:3306"
environment:
MYSQL_DATABASE: 'docker'
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
一切正常,mysql容器除外。
这拒绝了我的联系。
这是我的php文件里面代码文件夹中的消息:
(HY000/2002): Connection refused in /usr/share/nginx/html/index.php on line 2
当我使用exec -it bash输入mysql容器并输入'mysql'时,同样的事情,root @ localhost的访问被拒绝。
在容器内,我尝试启动'mysqld'并告诉我
2016-07-16T09:56:02.777893Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2016-07-16T09:56:02.778010Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2016-07-16T09:56:03.779967Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2016-07-16T09:56:03.780182Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
任何帮助将不胜感激!!!!
谢谢
微米。