Answer the question
In order to leave comments, you need to log in
Laravel Homestead DB port 5432 is running - site, but artisan is broken, 54320 is running artisan - site is broken?
The whole point is in the question, if in the .env file such a port DB_PORT=54320
runs console commands with php artisan migrate, tables are created, etc., but the site gives an error:
SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host
"127.0.0.1" and accepting TCP/IP connections on port 54320? (SQL: select * from "users" where
"id" = 1 and "users"."deleted_at" is null limit 1)
DB_PORT=5432
is working on the site, the same error is displayed in the console if you enter artisan migrate and other commands related to the database. Last login: Thu Sep 7 11:03:40 2017 from 10.0.2.2
[email protected]:~$ ps -f -u postgres
UID PID PPID C STIME TTY TIME CMD
postgres 897 1 0 11:03 ? 00:00:00 /usr/lib/postgresql/9.5/bin/postgres -D /var/lib/postgresql/9.5/main -c config_file=/etc/postgresql/9.5/main/postgresql.conf
postgres 922 897 0 11:03 ? 00:00:00 postgres: checkpointer process
postgres 923 897 0 11:03 ? 00:00:00 postgres: writer process
postgres 924 897 0 11:03 ? 00:00:00 postgres: wal writer process
postgres 925 897 0 11:03 ? 00:00:00 postgres: autovacuum launcher process
postgres 926 897 0 11:03 ? 00:00:00 postgres: stats collector process
[email protected]:~$ psql -U homestead -h localhost my_db_name
Password for user homestead:
psql: FATAL: database "my_db_name" does not exist
Last login: Tue Sep 5 08:35:23 2017 from 10.0.2.2
[email protected]:~$ psql -U homestead -h localhost my_db_name
Password for user homestead:
psql (9.5.7)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
my_db_name=# SHOW port;
port
------
5432
(1 row)
my_db_name=# SHOW listen_addresses;
listen_addresses
------------------
*
(1 row)
listen_addresses
------------------
*
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question