Database connection error(2)

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderators: General Support Moderators, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Dec 31, 2020 4:07 pm

Database connection error(2)

Post by lowjo98 » Thu Dec 31, 2020 5:22 pm

Hi all,

I've been having issues with connecting Joomla to an external mysql database where I get Database Connection error(2).

For reference, Joomla is on a CentOS machine ( and MySQL is on Debian ( I can confirm these two are properly connected as they can ping each other by IP and Hostname so I have the correct hostname set. I have also verified several times I am using the correct database user, password and database name by testing and checking in several times on the SQL server. I have also tried using the root sql account but that has failed.

This rules out Configuration.php as an issue since I verified the 4 possible issues.

I have also allowed httpd_network_connect and connect_db in SELinux on the CentOS box (going as far as just setting SELinux to permissive). I have also set all Iptables rules to any2any permit to rule out firewall. In MySQL I binded the listening address to the IP ( so MySQL is listening on that IP. Lastly, I've verified the MySQL user account permissions and configuration.php's rwx permissions (it is 644).

For context, I was able to install joomla on a localhost database hosted by the CentOS but it would fail when trying to change to the debian database during install and after install.

Any help or ideas would be appreciated

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27568
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Database connection error(2)

Post by Per Yngve Berg » Thu Dec 31, 2020 7:20 pm

Can you connect to the database with Mysql Workbench?

Post Reply

Return to “Installation Joomla! 3.x”