相关疑难解决方法(0)

Laravel:错误[PDOException]:无法在PostgreSQL中查找驱动程序

我正在尝试通过Laravel连接PostgreSQL数据库,以便进行php工匠迁移,但似乎没有被定向,因为它正在读取MySQL的数据库名称.

以下是来自database.php的命令:

'connections' => array(

    'sqlite' => array(
        'driver'   => 'sqlite',
        'database' => __DIR__.'/../database/production.sqlite',
        'prefix'   => '',
    ),

    'mysql' => array(
        'driver'    => 'mysql',
        'host'      => 'localhost',
        'database'  => 'database',
        'username'  => 'root',
        'password'  => '',
        'charset'   => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix'    => '',
    ),

    'pgsql' => array(
        'driver'   => 'pgsql',
        'host'     => 'localhost',
        'database' => 'postgres',
        'username' => 'postgres',
        'password' => 'root',
        'charset'  => 'utf8',
        'prefix'   => '',
        'schema'   => 'public',
    ),

    'sqlsrv' => array(
        'driver'   => 'sqlsrv', …
Run Code Online (Sandbox Code Playgroud)

php database postgresql syntax-error laravel

65
推荐指数
6
解决办法
22万
查看次数

Laravel 5 PDOException无法找到驱动程序

我使用Laravel 5时遇到问题.当我运行"php aritsan migrate"时,我收到了这个错误

**************************************
*     Application In Production!     *
**************************************

Do you really wish to run this command? [y/N] y

[PDOException]
could not find driver
Run Code Online (Sandbox Code Playgroud)

我可以运行应用程序,但是当需要数据库连接时,我收到了这个错误

PDOException in Connector.php line 55:
could not find driver
in Connector.php line 55
at PDO->__construct('mysql:host=localhost;dbname=mydb', 'root', '', array('0', '2', '0', false, false)) in Connector.php line 55
at 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' …
Run Code Online (Sandbox Code Playgroud)

php mysql laravel laravel-5

27
推荐指数
8
解决办法
11万
查看次数

标签 统计

laravel ×2

php ×2

database ×1

laravel-5 ×1

mysql ×1

postgresql ×1

syntax-error ×1