Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql can't connect application server through PGAdmin4

I installed PostgreSql on my Windows machine. I can connect to PostgreSql through cmd. But when I want to launch pgAdmin I am getting this error message.

Failed to connect to the pgAdmin application server. Click here to try again.

I have also Mysql installed on my machine if it can make any complications.

like image 959
LucasPG Avatar asked Oct 17 '16 09:10

LucasPG


2 Answers

The same problem happened to me today:

enter image description here

And this is how I've solved it:

1) Use a text editor to open the config_distro.py file under the c:\Program Files\pgAdmin 4\v1\web folder. Change the value for SERVER_MODE from True to False, then save the change. (I have run Notepad++ as an Administrator, in order to be able to save in this protected folder.)

enter image description here

2) Go to folder c:\Users\your_name\AppData\Roaming\pgAdmin and make sure there is nothing there (delete all the files, as they are temporary and will be restored after starting pgAdmin)

enter image description here

3) Start pgAdmin

enter image description here

4) This time you will see a white box that sits - at least, on my slow laptop - about 20 seconds. (You may briefly see the original error message, but do not worry).

enter image description here

5) Meanwhile, the temporary files - required for running the application - are created.

enter image description here

6) Once the temporary files process is over, the application starts as expected.

enter image description here

like image 177
Sorin Călinică Avatar answered Oct 23 '22 10:10

Sorin Călinică


Try starting the pgAdmin as administrator.

like image 21
Daniel Avatar answered Oct 23 '22 09:10

Daniel