Translate: "我正在尝试通过Laravel连接到PostgreSQL数据库,以便执行php artisan migrate命令,但似乎没有成功,因为它正在读取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',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),
),
如果我删除MySQL的路径,我会得到:
[InvalidArgumentException] Database [mysql] not configured.
Translate: "PHP 版本 5.5.12
编译器 MSVC11 (Visual C++ 2012) 配置命令 cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:php-sdkoraclex64instantclient10sdk,shared" "--with-oci8=C:php-sdkoraclex64instantclient10sdk,shared" "--with-oci8-11g=C:php-sdkoraclex64instantclient11sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--disable-static-analyze" "--with-pgo""
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
"对于 PDOException: could not find driver for MySQL 错误,如果是基于 Debian 的操作系统