• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Resolved Unable to connect to database

Pentarou

Basic Pleskian
Hello,

I have downloaded and installed the latest NextCloud docker image and set the port and firewall configurations properly. I am welcomed by the NextCloud installer and choose to use the MySQL / MariaDB database and made sure that I entered the correct login details. However, NextCloud could not connect to the database with the following error:

Code:
Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory

I suspect it is a firewall issue nonetheless, does anyone have an idea how to fix it?

Thank you in in advance!
 
  1. Produce a MySQL Dump (mysqldump -u username -p --all-databases > dump.sql)
  2. Delete all mysql-packages (dpkg --purge mysql...)
  3. Reinstall mysql
mysql -u root -p

CREATE DATABASE owncloud;
GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'set_database_password';
FLUSH PRIVILEGES;

  1. Restore MySQL Dump (mysql -u username -p database_name < dump.sql)
  2. Backup /var/www/owncloud/config + /var/www/owncloud/data
  3. Delete all owncloud* Packages
  4. Reinstall owncloud
  5. Restore /var/www/owncloud/config + /var/www/owncloud/data from backup
How To Install and Configure ownCloud on Ubuntu 16.04 | DigitalOcean
 
Hello m3lezZ, and thank you kindly for your reply.

I do not think that reinstalling the database will help. I found this article that suggests that I use the server IP and port number as the address of the database server, which I have tried, and gave me the following error:

Code:
Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused

Again it seems that it is a firewall problem, but my database is configured to allow remote connections from any host, so I'm a bit confused.
 
There is no such file, but /etc/init.d/psa-firewall, which you can view here.

I can't reach port 3306 from Powershell, so at least I know it's a firewall issue now.
 
Back
Top