是否可以在 Laravel 中使用 mysqli 作为数据库驱动程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31787259/
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
Is it possible to use mysqli as database driver in Laravel?
提问by Sabbir Ahmed Sourove
Configuration for database in laravel is:
laravel 中数据库的配置是:
'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' => '',
],
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?
它使用 PDO 连接来连接 mysql 服务器。有什么方法可以将其配置为使用 mysqli 而不是 PDO 驱动程序。我在 Laravel 中使用 PDO 驱动程序读取运行数据库的错误消息时遇到问题。有没有办法使用mysqli?
回答by Your Common Sense
Is there any way to use mysqli?
有没有办法使用mysqli?
No.
不。
I am facing problem to read error message
我在阅读错误消息时遇到问题
Just fix that problem.
If you think there is any problem with PDO, why not to ask a question regarding that problem?
解决这个问题就行了。
如果您认为 PDO 有任何问题,为什么不就该问题提出问题呢?