Resolved Database connection error (1): The MySQL adapter 'mysql' is not available by Joomla CMS

Status
Not open for further replies.

costas1

Member
Messages
146
Reaction score
4
Points
18
A few months back the website was certainly working fine. For some time it was probably served and kept online by Cloudflare's servers. Today after changing Cloudflare's DNS settings to point to the x12 server (it used to point to x3 as far as I remember) this message came up:

Database connection error (1): The MySQL adapter 'mysql' is not available.

So what's the cause and can it be fixed? Thanks in advance!
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
252
Points
63
Can you please check your PHP settings in DirectAdmin? If you are NOT using native PHP, the MySQL extension may be disabled. It must either be enabled, or the version switched the native. Please note that MySQLi is the extension that is most commonly used and without the "i" is the old version that is not supported anymore.
 

Anna

I am just me
Staff member
Messages
11,768
Reaction score
590
Points
113
If your code rely on the old mysql extension (removed and replaced with more secure options starting php version 7.0), you would need to change the php version to 5.6.

Though a properly updated Joomla install should be able to handle the newer mysqli or PDO extensions, it is possible you need to make a small edit to the configuration file though for that.
 

costas1

Member
Messages
146
Reaction score
4
Points
18
Can you please check your PHP settings in DirectAdmin? If you are NOT using native PHP, the MySQL extension may be disabled. It must either be enabled, or the version switched the native. Please note that MySQLi is the extension that is most commonly used and without the "i" is the old version that is not supported anymore.

Yes, I checked the extensions and I figured that out. Read also my answer to Anna.

If your code rely on the old mysql extension (removed and replaced with more secure options starting php version 7.0), you would need to change the php version to 5.6.

Though a properly updated Joomla install should be able to handle the newer mysqli or PDO extensions, it is possible you need to make a small edit to the configuration file though for that.

Instead of changing to PHP 5.6, I switched to 7.3 (because I plan to use MediaWiki and the minimum version of PHP for the latest version of the wiki is 7.2.9) and I enabled the following set of extensions: mysqlnd, nd_mysqli and pdo_mysql. I'm not really sure if pdo_mysql is really compatible with mysqlnd, but I'm able to enable and disable pdo_mysql with the other 2 extensions enabled without getting any messages about a conflict, as it happens with other extensions. Please, if you know about their compatibility, confirm.

Then I changed Joomla's configuration file to use the mysqli extension for connecting to its database instead of the mysql one.
 
Status
Not open for further replies.
Top