Solved Me again......This time its phpMyAdmin

76
19
NAS
DS916+
Operating system
  1. Windows
Mobile operating system
  1. Android
Hello all,

I thought what a lovely day with the sun out, I'd sit inside and try and continue setting up NextCloud / MariaDB /phpMyAdmin in Docker.

As you may know, I've managed to install (with the help of you all) MariaDB and Nextcloud, however I still have phpMyAdmin to go. Now with this having to link directly with MariaDB in order for NextCloud to work, I wanted to ask yourselves for guidance before I started this time, rather than when I got stuck. I've looked around for the different settings, ie port, volume & environment variables for phpMyAdmin, however I didn't have much look, or when I did, it didn't reflect what I wanted to achieve.

Anyways, I've attached some screenshots of the settings I have for MariaDB and NextCloud, and I would really appreciate guidance so that I can proceed with installing phpMyAdmin and in turn NextCloud.

Thanks in advance.
 

Attachments

  • 20200514_132349.jpg
    20200514_132349.jpg
    37.4 KB · Views: 277
  • 20200514_132406.jpg
    20200514_132406.jpg
    34.3 KB · Views: 248
  • 20200514_132425.jpg
    20200514_132425.jpg
    35.2 KB · Views: 200
  • 20200514_132454.jpg
    20200514_132454.jpg
    36 KB · Views: 249
Last edited:
The only thing you need if you are using the official phpmyAdmin image are 2 variables:

PMA_PORT
PMA_HOST

Port is the port number of your mariaDB instance and host will be your NAS IP address where maria is hosted/installed.

Hello,

Thank you for replying.

I am using the official image and so I entered those two variables as you suggested, whilst leaving everything else alone.....I didn't change the port number, or add any volume info.

I went to NextCloud and attempted to create an Admin account, entered a username and password, data folder to /docker/nextcloud/data, set database to MySQL/MariaDB, username - root, password set, name - NextCloud, database host - localhost:3306, unfortunately however after 30 seconds or so I get the following error; "Error trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory".

Someone suggested using IP 127.0.0.1 instead of localhost, however when I try that I get the following error; Error while trying to create admin user: Failed to connect to the database: "An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused"
 

Attachments

  • 20200514_150110.jpg
    20200514_150110.jpg
    27.6 KB · Views: 138
  • 20200514_145721.jpg
    20200514_145721.jpg
    38.2 KB · Views: 143
  • 20200514_144511.jpg
    20200514_144511.jpg
    40.8 KB · Views: 139
  • 20200514_144309.jpg
    20200514_144309.jpg
    17.9 KB · Views: 120
  • 20200514_144321.jpg
    20200514_144321.jpg
    40 KB · Views: 122
Ok this now has no relation to phpnyadmin. It’s used for mariadb or mysql configurations.

What you have here is a cloud configuration error regarding database connection.

Try and use ip address of your nas instead of localhost and see if that will get you further. Rest of the mappings and configuration looks valid (regarding your cloud data folder)
 
Ok this now has no relation to phpnyadmin. It’s used for mariadb or mysql configurations.

What you have here is a cloud configuration error regarding database connection.

Try and use ip address of your nas instead of localhost and see if that will get you further. Rest of the mappings and configuration looks valid (regarding your cloud data folder)

Thanks, just tried my IP unfortunately I get a timeout error. On a side note however, if I point my browser to port 3306 (MariaDB) I get a "This page isn't working" message.
 

Attachments

  • Screenshot_20200514-152845_Chrome.jpg
    Screenshot_20200514-152845_Chrome.jpg
    45.6 KB · Views: 56
  • Screenshot_20200514-153041_Chrome.jpg
    Screenshot_20200514-153041_Chrome.jpg
    25.1 KB · Views: 56
Don’t expect to get anything via 3306 via browser. that’s a sql port.

Make sure that both containers do work regarding network visibility

Just checked phpMyAdmin, and that comes up in my browser ok, albeit I don't have a password to login (one hasn't been set in the environment page).
 

Attachments

  • Screenshot_20200514-155152_Chrome.jpg
    Screenshot_20200514-155152_Chrome.jpg
    30.1 KB · Views: 130
  • Screenshot_20200514-155308_Chrome.jpg
    Screenshot_20200514-155308_Chrome.jpg
    60.8 KB · Views: 132
Try root as username and the root sql password that you have defined in the mariadb container variable

That returns; "Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Operation timed out"
 
I would say that php and maria can’t see each other

If phpMyAdmin has the port number of MariaDB set as a variable, ie "3306", does MariaDB need a port variable set in order to see phpMyAdmin?
 

Attachments

  • Screenshot_20200514-165152_Chrome.jpg
    Screenshot_20200514-165152_Chrome.jpg
    47.6 KB · Views: 63
  • 20200514_165122.jpg
    20200514_165122.jpg
    46.9 KB · Views: 63
No there is no need. As long you are certain that maria works on that port and that both containers can talk to each other then it should work. Considering that timeout error I would say there is some sort of network visibility

Is there a way I can confirm it is running, other than just going off that Docker says its running?
 
you could test it from your computer. Using a terminal or command line.

telnet ipaddressofyournas 3306

Run this and you will see the outcome.

Thanks.

Just used JuiceSSH and got the attached response back.
 

Attachments

  • 20200514_171735.jpg
    20200514_171735.jpg
    13.4 KB · Views: 119
Ok good so the mariadb is working just fine. Now to figure out why php can’t connect to your instance.

So you tried using root account and the defined root password and got that it can’t create that user. that’s a bit odd I have to say. Do you have any files created in the maria docker volume folder?
 
Ok good so the mariadb is working just fine. Now to figure out why php can’t connect to your instance.

So you tried using root account and the defined root password and got that it can’t create that user. that’s a bit odd I have to say. Do you have any files created in the maria docker volume folder?

Hi,

There's nothing in the Mariadb docker folder.
 

Attachments

  • 20200514_182136.jpg
    20200514_182136.jpg
    32 KB · Views: 67
Guess that’s because you mounted it wrong.

Mariadb docker image uses this to mount:

Code:
v /my/own/datadir:/var/lib/mysql

So make sure that you mount /var/lib/mysql path and then try again.

1st check the folder if the content is there then it’s f it is access it via php
 
Last edited:
Guess that’s because you mounted it wrong.

Mariadb docker image uses this to mount:

Code:
v /my/own/datadir:/var/lib/mysql

So make sure that you mount /var/lib/mysql path and then try again.

1st check the folder if the content is there then it’s f it is access it via php

Hi just logged in and seen your suggestion. Just changed MariaDB volume to;
(File/Folder) /docker/MariaDB
(Mount path) /var/lib/mysql

I've tried creating an Admin NextCloud account again, however I still get error;
"Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Operation timed out"

I've tried different variants in Database host;
localhost:3306
192.168.1.67:3306
127.0.0.1:3306

On that last variant (127.0.0.1:3306) the error changed to;
"Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused"

Lastly, I tried logging into phpMyAdmin using root:rootpassword and it would let me, and so I created an additional user in the environment variables; Admin:rootpassword however that gives me the same error; "mysqli::real_connect(): (HY000/2002): Connection timed out"

Do you think that it may be phpMyAdmin that's setup wrong?
 

Attachments

  • Screenshot_20200515-093610_Chrome.jpg
    Screenshot_20200515-093610_Chrome.jpg
    35.5 KB · Views: 98
  • 20200515_093654.jpg
    20200515_093654.jpg
    48.1 KB · Views: 99
Last edited:
It's finally working. I kept trying the new user I set in the environment variables (Admin:rootpassword) and it finally went through.

I feel like I'm on the home stretch now.

Everything is running locally just as it should however attempting to access remotely using the reverse proxy I set, is returning the error; "edit the" trusted_domains" setting in config.php". After a quick Google and search around the Docker folder, I found the config.php file and edited it as attached (added my Synology.me address for NextCloud to the array), however it makes no difference and I still get the same error message and it does not let me access remotely.

I have a Letsencrypt certificate created and assigned to that reverse proxy.



***Edit - Finally all working, I just had to remove the port number from the config file for remote access to work.

As always, thanks for your help........until next time. :ROFLMAO:
 

Attachments

  • 20200515_105125.jpg
    20200515_105125.jpg
    28 KB · Views: 126
  • Screenshot_20200515-105405_Gallery.jpg
    Screenshot_20200515-105405_Gallery.jpg
    20.6 KB · Views: 125

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top