Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql:
- restart: always
- image: mysql:5.7
- container_name: mysql
- environment:
- - MYSQL_ROOT_PASSWORD=12345
- - MYSQL_DATABASE=abc
- - MYSQL_USER=abc
- - MYSQL_PASSWORD=abc
- nginx:
- restart: always
- image: phpdockerio/nginx:latest
- container_name: nginx
- volumes:
- - ..:/www/example.com
- - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ports:
- - "80:80"
- links:
- - php-fpm
- php-fpm:
- restart: always
- build: .
- dockerfile: php-fpm/Dockerfile
- container_name: php-fpm
- volumes:
- - ..:/www/example.com
- - ./php-fpm/php-ini-overrides.ini:/etc/php/7.1/fpm/conf.d/99-overrides.ini
- links:
- - mysql
- [Note] Server hostname (bind-address): '*'; port: 3306
- [Note] IPv6 is available.
- [Note] - '::' resolves to '::';
- [Note] Server socket created on IP: '::'.
- mysql | 2017-01-14T09:53:06.345013Z 0 [Note] mysqld: ready for connections.
- mysql | Version: '5.7.17' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
- return [
- 'class' => 'yiidbConnection',
- 'dsn' => 'mysql:host=127.0.0.1;dbname=abc',
- 'username' => 'root',
- 'password' => '12345',
- 'charset' => 'utf8',
- ];
- $ret = Yii::$app->db->createCommand('SHOW VARIABLES')->queryAll();
- print_r($ret);
- Database Exception – yiidbException
- SQLSTATE[HY000] [2002] Connection refused
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement