小编Far*_*zem的帖子

在 pg_restore 命令行窗口中自动输入用户密码

我想在命令行中使用 pg_restore 恢复我的数据库 postgres 并且我想将用户的密码直接放在命令中,我试过这个命令但不起作用

pg_restore -h localhost -p 5432 -U postgres -W 123 -d my_db my_backup.backup
Run Code Online (Sandbox Code Playgroud)

但显示以下消息

pg_restore: too many arguments on the command line (the first being "-d")
Run Code Online (Sandbox Code Playgroud)

postgresql cmd postgresql-9.5

5
推荐指数
1
解决办法
5473
查看次数

将 postgres 与 laravel 连接起来

您好,我正在尝试将laravel 5.4 与postgres 连接,更新数据库配置文件并运行后php artisan migrate,出现以下错误:

[Illuminate\Database\QueryException]
 could not find driver (SQL: select * from information_schema.tables where t
 able_schema = public and table_name = migrations)
[PDOException]
 could not find driver
Run Code Online (Sandbox Code Playgroud)

这是我的.env文件

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=Portail
DB_USERNAME=php
DB_PASSWORD=php
Run Code Online (Sandbox Code Playgroud)

这是我的database.php文件

'default' => env('DB_CONNECTION', 'pgsql'),
 'pgsql' => [
            'driver' => 'pgsql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'Portail'),
            'username' => env('DB_USERNAME', 'php'),
            'password' => env('DB_PASSWORD', 'php'),
            'charset' => 'utf8',
            'prefix' => '', …
Run Code Online (Sandbox Code Playgroud)

php postgresql laravel laravel-5 laravel-5.4

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

postgresql ×2

cmd ×1

laravel ×1

laravel-5 ×1

laravel-5.4 ×1

php ×1

postgresql-9.5 ×1