title: Connection Refused Error installing Nextcloud on Synology NAS
body: <p>Trying to install Nextcloud on a Synology NAS following <a href="https://mariushosting.com/how-to-install-nextcloud-on-your-synology-nas/" rel="nofollow noreferrer">this guide</a>.</p>
  
  <p>I am stuck on step 9. When I hit "Finish Setup" I get the following error:</p>
  
  <blockquote>
    <p>Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused</p>
  </blockquote>
  
  <p>MariaDB is running on port 3307 and I am using 127.0.0.1:3307 in the Database Host field.</p>
  
  <p>I have set the root password for MariaDB and validated that it works with phpMyAdmin.</p>
  
  <p>The Apache log shows me this (not sure if it's related):</p>
  
  <pre><code>2020-02-07T09:06:52+01:00 Synology [Fri Feb 07 09:06:52.842797 2020] [core:alert] [pid 32462:tid 140624225343232] [client 192.168.1.50:34372] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:07:06+01:00 Synology [Fri Feb 07 09:07:06.128359 2020] [core:alert] [pid 32462:tid 140624191772416] [client 192.168.1.50:34378] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:07:20+01:00 Synology [Fri Feb 07 09:07:20.905597 2020] [core:alert] [pid 32462:tid 140624015525632] [client 192.168.1.50:34383] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:08:49+01:00 Synology [Fri Feb 07 09:08:49.110084 2020] [core:alert] [pid 32462:tid 140624099452672] [client 192.168.1.50:34388] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:11:12+01:00 Synology [Fri Feb 07 09:11:12.579977 2020] [core:alert] [pid 32462:tid 140624208557824] [client 192.168.1.50:34394] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:12:10+01:00 Synology [Fri Feb 07 09:12:10.283186 2020] [core:alert] [pid 32462:tid 140624183379712] [client 192.168.1.50:34399] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:20:09+01:00 Synology [Fri Feb 07 09:20:09.222903 2020] [core:alert] [pid 32462:tid 140624057489152] [client 192.168.1.50:34437] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  2020-02-07T09:22:44+01:00 Synology [Fri Feb 07 09:22:44.829287 2020] [core:alert] [pid 32462:tid 140624074274560] [client 192.168.1.50:34459] /var/services/web/nextcloud/data/.htaccess: Expected &lt;/IifModule&gt; but saw &lt;/IfModule&gt;
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>