Hello/Hi/Greetings,
Hi All,
Currently in the process of installing Piwigo on Docker with MySQL. I'm not new to MySQL or Piwigo however I am to Docker.
My basic steps are as follows and they seem to work fine.
Install of MySQL DB
docker run -d -p 3306:3306 --name piwigo_db \
-e MYSQL_ROOT_PASSWORD=piwigo \
-e MYSQL_DATABASE=piwigo_db \
-e MYSQL_USER=piwigo \
-e MYSQL_PASSWORD=piwigo \
-v /data/var/lib/mysql \
mysql
And then Install of Piwigo
docker create \
--name=piwigo_web \
-e PUID=1000 \
-e PGID=1000 \
-p 80:80 \
-v /data/config:/config \
--restart unless-stopped \
linuxserver/piwigo
When I navigate to the Piwigo installer I get "Cannot connect to server" error.
If I look in the logs I can see php doesn't seem to be able to connect to the Database
2019/04/22 00:45:52 [error] 291#291: *25 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 67
PHP message: PHP Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 67
PHP message: PHP Warning: mysqli::set_charset(): Couldn't fetch mysqli in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 103" while reading response header from upstream, client: 1.125.110.170, server: _, request: "POST /install.php?language=en_GB HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "my.host.org", referrer: "http://my.host.org/install.php?language=en_GB"
2019/04/22 00:49:17 [error] 291#291: *31 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 67
PHP message: PHP Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 67
PHP message: PHP Warning: mysqli::set_charset(): Couldn't fetch mysqli in /config/www/gallery/include/dblayer/functions_mysqli.inc.php on line 103" while reading response header from upstream, client: 1.125.110.170, server: _, request: "POST /install.php?language=en_GB HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "my.host.org", referrer: "http://my.host.org/install.php?language=en_GB"
I can connect via command line successfully
`$ mysql -u piwigo -h 172.31.9.172 -p`
root@ip-172-31-9-172:/data/config/log/nginx# mysql -u piwigo -h 172.31.9.172 -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.15 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| piwigo_db |
+--------------------+
2 rows in set (0.00 sec)
mysql>
Piwigo version: 2.9.5
PHP version: ?? - what ever is inside of https://hub.docker.com/r/linuxserver/piwigo/ - Current is
MySQL version: what ever is inside of https://hub.docker.com/_/mysql
Piwigo URL: N/A
Offline
Hello,
I have exactly the same problem. I don't suppose you found the answer?
thanks
Peter.
Offline
Hi all, I'm still having this problem. Does anyone have any idea?
Offline
Hi,
I might be able to help you. The main reason why the creator of the original post did not succeed is, that the containers have no means to communicate with each other.
If you would like to try my way of setting Piwigo up on a Synology NAS try it with Docker Compose:
# Use root/example as user/password credentials version: '3.1' networks: piwigo: name: piwigo driver: bridge services: db: image: mariadb container_name: mariadb-piwigo restart: always environment: MYSQL_ROOT_PASSWORD: sompass MYSQL_DATABASE: piwigo MYSQL_USER: someuser MYSQL_PASSWORD: somepass networks: - piwigo volumes: - /volume1/docker/mariadb:/var/lib/mysql piwigo: image: linuxserver/piwigo container_name: piwigo environment: - PUID=1000 - PGID=1000 - TZ=Europe/Berlin networks: - piwigo volumes: - /volume1/docker/piwigo/config:/config ports: - 8081:80 restart: unless-stopped
Naturally you have to change some values to your liking or to suit your system respectively but it should get you running. You have to create the folders that are to be mounted as volumes on your system manually. Even these you might have to change.
Note the "networks" section. Being on the same virtual network enables Docker containers to communicate with each other.
Do not hesitate to ask me if you have problems, I learned quite a lot about Docker in this process, even if I am far from being an expert.
Offline
Hi,
@eTaurus
There is no need for the network section, see here: https://docs.docker.com/compose/networking/
Also, unfortunately your example doesn't work - same behavior.
Anybody tried taurus' example?
The containers can ping each other with their hostnames.
How do we check the mysql side? Users in place, priviliges granted..
A small working example would be needed. Mine does not work:
version: "2" services: db: image: mysql:latest restart: always environment: MYSQL_ROOT_PASSWORD: test MYSQL_DATABASE: test MYSQL_USER: test MYSQL_PASSWORD: test volumes: - /data_4TB/piwigo/db:/var/lib/mysql app: image: linuxserver/piwigo environment: - PUID=1000 - PGID=1000 - TZ=Europe/Paris volumes: - /data_4TB/piwigo/conf:/config - /data_4TB/piwigo/pics:/pictures ports: - 9988:80 restart: unless-stopped
Last edited by icke-icke (2020-01-07 23:04:18)
Offline