在Laravel中可以使用mysqli作为数据库驱动程序吗? [英] Is it possible to use mysqli as database driver in Laravel?

查看:672
本文介绍了在Laravel中可以使用mysqli作为数据库驱动程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

laravel中数据库的配置为:

Configuration for database in laravel is:

'mysql' => [
'read' => [
    'host' => '192.168.1.1',
],
'write' => [
    'host' => '196.168.1.2'
],
'driver'    => 'mysql',
'database'  => 'database',
'username'  => 'root',
'password'  => '',
'charset'   => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix'    => '',
],

它使用PDO连接来连接mysql服务器,是否有任何方法可以将其配置为使用mysqli而不是PDO驱动程序.我在laravel中使用PDO驱动程序读取运行数据库的错误消息时遇到问题.有什么方法可以使用mysqli吗?

It used PDO connection to connect mysql server.Is there any way to configure it to use mysqli instead of PDO driver. I am facing problem to read error message of running database using PDO driver in laravel. Is there any way to use mysqli?

推荐答案

有什么方法可以使用mysqli吗?

Is there any way to use mysqli?

否.

我在阅读错误消息时遇到了问题

I am facing problem to read error message

只需解决该问题即可.
如果您认为PDO有任何问题,为什么不提出有关该问题的问题?

Just fix that problem.
If you think there is any problem with PDO, why not to ask a question regarding that problem?

这篇关于在Laravel中可以使用mysqli作为数据库驱动程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆