I have updated the DB connection in my .env file to change the default mysql database to use PostgreSQL DB. But I don't know how to proceed with this.
DB_CONNECTION=pgsql
For example, we use
mysql -uhomestead -psecret <DB Name>
to connect to our database. By using psql, how to connect to DB?
Laravel makes connecting with Postgres databases and running queries extremely simple out of the box. The Postgres database configuration for your application is located at Laravel Project Root Folder, config/database. php . In this file you may define Postgres database connection for your Laravel Application.
Connecting To Your Databases To connect to your MySQL or Postgres database from your main machine via Navicat or Sequel Pro, you should connect to 127.0. 0.1 and port 33060 (MySQL) or 54320 (Postgres). The username and password for both databases is homestead / secret .
Try this one,
psql -U homestead -h localhost <DB Name>
After that, it will ask for password, enter secret. That's it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With