为了账号安全,请及时绑定邮箱和手机立即绑定

Laravel 5 PDOException找不到驱动程序

Laravel 5 PDOException找不到驱动程序

蝴蝶刀刀 2019-12-04 14:47:37
我在使用Laravel 5时遇到问题。当我运行“ php aritsan migration”时,出现此错误***************************************     Application In Production!     ***************************************Do you really wish to run this command? [y/N] y[PDOException]could not find driver我可以运行该应用程序,但是当需要数据库连接时,出现此错误PDOException in Connector.php line 55:could not find driverin Connector.php line 55at PDO->__construct('mysql:host=localhost;dbname=mydb', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55at Connector->createConnection('mysql:host=localhost;dbname=mydb', array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'mydb', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22如何解决?
查看完整描述

3 回答

?
千巷猫影

TA贡献1829条经验 获得超7个赞

这将取决于您的php版本。检查它是否正在运行:


php -version

现在,根据您当前的版本,运行:


sudo apt-get install php7.2-mysql


查看完整回答
反对 回复 2019-12-04
  • 3 回答
  • 0 关注
  • 728 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信