Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
Error
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
Solution for CentOS 7
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7
Install your database server and create databases
sudo yum install postgresql-server postgresql-contrib
sudo postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
$ psql
psql: FATAL: role "frank" does not exist
$ sudo -i -u postgres
-bash-4.2$ psql
create database frank; #create database <username>;
# So if I have a user called frank, that role will attempt to connect to a database called frank by default.
Then you get into another error probably
Knex:Error Pool2 - error: Ident authentication failed for user "frank"
Knex:Error Pool2 - error: Ident authentication failed for user "frank"
Solution
$ sudo vi /var/lib/pgsql/data/pg_hba.conf
Change ident => md5
https://serverfault.com/questions/406606/postgres-error-message-fatal-ident-authentication-failed-for-user
sudo -u postgres createuser frank
sudo -i -u postgres
-bash-4.2$ createuser --interactive # important to be under psql superuser otherwise it will fail
-bash-4.2$ psql
psql> CREATE ROLE <username>
psql> create database frank;
/* not needed maybe sudo yum install oidentd
*/
Yay now another error!
Knex:Error Pool2 - error: password authentication failed for user "frank"
Knex:Error Pool2 - error: password authentication failed for user "frank"
https://github.com/tgriesser/knex/issues/1637
Recent Comments