0
Guys I have a problem accessing a database that is in a Virtual Machine
.
I have a machine A
that has an application Laravel
all configured and the project installed, and has another machine B
where is my database, which is also configured.
In the archive .env
is using the default VM settings.
I read some tutorials to free up access to the bank, inside the archive pg_hba.conf
and the file postgresql.conf
. In these files I made the default to free the access, but when access the on the machine A
and execute the command php artisan migrate
an error appears and connection timeout
and I can’t connect to the database.
What is the possible solution for this ?
And what modifications have you made to
pg_hba.conf
and in thepostgresql.conf
specifically for this purpose?– anonimo
1 . in the archive
/etc/postgresql/9.6/main/postgresql.conf
#listen_addresses = 'localhost'
forlisten_addresses = '*'
2 . in the file/var/lib/postgresql/9.6/pg_hba.conf
add next line at the end of the filehost all all 0.0.0.0/0 md5
– Romulo Sousa
Ai with these settings was to have remote access.
– Romulo Sousa
Reload the configuration files? For example with:
select pg_reload_conf();
.– anonimo
I don’t think so, I’ll check.
– Romulo Sousa
How would I do that ?
– Romulo Sousa
I made the
service postgres restart
– Romulo Sousa
It worked, it was just the server IP that was wrong, I gave a
sudo ifconfig
.– Romulo Sousa