Getting Error SQLSTATE[HY000] [2002] Connection refused on NAS Synology

前端 未结 5 1475
一个人的身影
一个人的身影 2021-01-14 05:37

I am making an under construction page which is hosted on my Synology NAS.

Visitors can subscribe with their email and get informed when the website will be availabl

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 06:01

    I had the same problem.

    I ended up solving it by enabling TCP/IP connection with Port: 3307. You may do that by opening the MariaDB 10 options in the Synology Package Center.

    Then instead of: mysqli_connect("127.0.0.1", "root", "", DB_NAME);

    I appended a the port number to it as the 5th parameter: mysqli_connect("127.0.0.1", "root", "", DB_NAME, 3307);

提交回复
热议问题