Advertisement

Can't connect to database even with known good credentials Topic is solved

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

Moderator: 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
maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 467
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Can't connect to database even with known good credentials

Post by maestroc » Wed Feb 05, 2025 2:15 am

Posting here on the chance someone knows what to try. I am aware that this probably isn't a Joomla specific thing.

I have a joomla site on a cpanel server. It was an old one that was still running SQL5. I ran the updater to take SQL up to version 8 and after doing so I started getting the "Error: Failed to start application: Could not connect to MySQL server."

On the chance something got corrupted I then took a known good backup of the site and restored it using Akeeba. When I got to the DB page I entered a new db, user, and password that I had just created. At this point I once again get the Error: Failed to start application: Could not connect to MySQL server.

Any idea what could have happened to screw things up? It is like the hosting account can't see SQL even though I created the database using the account's cpanel and can see the tables of other databases in it.

Advertisement
User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44978
Joined: Sat Apr 05, 2008 9:58 pm

Re: Can't connect to database even with known good credentials

Post by Webdongle » Wed Feb 05, 2025 3:01 am

Copy/pasting can often transfer hiden characters?
Try a simple PHP script to connect to the database.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

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

Re: Can't connect to database even with known good credentials

Post by Per Yngve Berg » Wed Feb 05, 2025 4:46 am

Have you given the User access to the Database?

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 467
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Can't connect to database even with known good credentials

Post by maestroc » Thu Feb 06, 2025 3:58 am

The cpanel people finally figured it out but I will post here as well in case someone needs it. In the end this was the fix:

With the release of MySQL 8, the default character set was changed to utfmb4. Updating to a version of PHP newer than 7.4 tends to resolve this. Alternatively, if you need to use an older version of PHP, the fix involves modifying the /etc/my.cnf file to set the default character set to UT8.


https://support.cpanel.net/hc/en-us/art ... the-client

Advertisement

Post Reply

Return to “Installation Joomla! 5.x”