• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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