Unable to connect to remote mysql with specific port


At my work, we are installed a nextcloud instance to put to file and make a POC.

We used a dedicated web server with NGINX in a DMZ and an internal MYSQL Server working on a specific port (8010).
Installation works successfully with dbserver:8010 but after installation, I got a 504 error.

After logging firewall, it appears Nextcloud tried to connect DB with 3306 port …

I tried to specify ‘dbport’ => ‘8010’ but it doesn’t work.

I tried to specify ‘dbhost’ => ‘mydbserver:8010’ without a dbport. With that config, I got a strange thing : URL is redirecting to : nextcloud.xxx.com/index.php/index.php

I tried nextcloud 14 and 15 with same issue.

Do someone already have this kind of issue ???
Thanks a lot for your answer


edit : correcting quote on dbhost

should be:

'dbhost' => 'mydbserver:8010'

(it’s probably just a typo here, make sure you didn’t forget the correct quoation mark ', or use the double quote ")

If that was the case, it could be a bug. However, can you check on the database server if there was a login attempt? And then on your host, if there is an outgoing request or if it is blocked somewhere (e.g. firewall).

Other way: use the command line on your server to connect to the database server and then a different php application, to prove that it works and is not system or network related.


quote is bad copy paste :slight_smile:
DB server is ok, we already connect with another server to mysql server so credential and DB are ok.
I tried to install through command line occ but same result …