• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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