1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Laravel][Homestead] 使用するデータベースをPostgreSQLに変更してみる

Posted at

データベースの初期設定がMySQLになっているので、安心のPostgreSQLに変更してみる。

PostgreSQLにログインしてみる

パスワードのデフォルトは「secret」。

$ psql -hlocalhost -Uhomestead

UTF8指定してデータベースを作成してみる

homestead=# CREATE DATABASE db_name ENCODING UTF8;

Laravelプロジェクトの設定を変更してみる

.env
...
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=db_name
DB_USERNAME=homestead
DB_PASSWORD=secret
...

参考

LaravelのHomestead環境でPostgreSQL初期設定を行う

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?