php 数据库连接错误(1):MySQL 适配器 'mysql' 不可用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25179367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:42:32  来源:igfitidea点击:

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

phpmysqljoomlaplesk

提问by Dghaies Ahmed

I Have a vps server with PHP 5.3.3 installed ,I added a new version 5.3.28 and switch my hosting to use FastCGI with PHP-5.3.28 now i get this "Database connection error (1): The MySQL adapter 'mysql' is not available.".I beleive i miss some configuration when installing the new PHP version.any help is appreciated

我有一个安装了 PHP 5.3.3 的 vps 服务器,我添加了一个新版本 5.3.28 并切换我的主机以使用 FastCGI 和 PHP-5.3.28 现在我得到这个“数据库连接错误(1):MySQL 适配器 'mysql ' 不可用。”。我相信我在安装新的 PHP 版本时错过了一些配置。感谢任何帮助

回答by Craig

It sounds like you've also change the available adpator to mysqlifrom mysql—?the message is saying the adapter mysqlis not availble.

听起来您也将可用适配器更改mysqlimysql-?消息说适配器mysql不可用。

Did you remember to change your Joomla configuration.phpfile to use mysqli?

您记得更改您的 Joomlaconfiguration.php文件以使用mysqli吗?

Open the Joomla (2.5 or 3.x) configuration.phpfile and look for the line:

打开 Joomla(2.5 或 3.x)configuration.php文件并查找以下行:

public $dbtype = 'mysql'

and change it to:

并将其更改为:

public $dbtype = 'mysqli'

If it isn't already…

如果还没有……

回答by Lodder

It simply means what it says. To fix the issue, you will need to enable the MySQLi adapter by opening your php.inifile and uncommenting extension=php_mysqli.dll. Once done, restart Apache for the changes to take effect.

它只是意味着它所说的。要解决此问题,您需要通过打开php.ini文件并取消注释来启用 MySQLi 适配器extension=php_mysqli.dll。完成后,重新启动 Apache 以使更改生效。

There may be an option on your VPS control panel, not sure but I would suggest looking there first.

您的 VPS 控制面板上可能有一个选项,不确定,但我建议先查看那里。

If you do not have this option, or do not have access to the php.inifile then you will need to contact your hosting provider

如果您没有此选项,或无权访问php.ini文件,则需要联系您的托管服务提供商

回答by user2905554

I have same problem.. and solve using this link.. the problem is mysql lib not installed. and you should install before run again (remember reload apache)

我有同样的问题..并使用此链接解决..问题是未安装mysql lib。你应该在再次运行之前安装(记住重新加载apache)

https://help.ubuntu.com/community/ApacheMySQLPHP

https://help.ubuntu.com/community/ApacheMySQLPHP

I hope the question solved by this link..

我希望这个链接解决了这个问题..

回答by user2997418

You may have many php.inifiles, the know the right file, you can run

你可能有很多php.ini文件,知道正确的文件,你可以运行

php --ini

The uncomment extension=php_mysqli.dllThen restart apache

取消注释extension=php_mysqli.dll然后重启apache

sudo service apache2 restart

回答by Mizael Clistion

Open the Joomla (2.5 or 3.x) configuration.php file and look for the line:

打开 Joomla(2.5 或 3.x)configuration.php 文件并查找以下行:

public $dbtype = 'mysql'

and change it to:

并将其更改为:

public $dbtype = 'mysqli'