我想在命令行中使用 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) 您好,我正在尝试将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)