Postgresql cannot connect application server via PGAdmin4

I installed PostgreSql on my windows machine. I can connect to PostgreSql via cmd. But when I want to run pgAdmin, I get this error message.

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

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

+5
source share
5 answers

The same thing happened to me today:

enter image description here

And this is how I decided it:

1) Use a text editor to open the config_distro.py file in the c: \ Program Files \ pgAdmin 4 \ v1 \ web section. >. Change the value of SERVER_MODE from True to False, and then save the change. (I launched Notepad ++ as an administrator to be able to save to this protected folder.)

enter image description here

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

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 can briefly review the original error message, but don’t worry.)

enter image description here

5) In the meantime, temporary files are created that are necessary to run the application.

enter image description here

6) As soon as the process of temporary files is completed, the application starts as expected.

enter image description here

+23
source

Try running pgAdmin as an administrator.

+5
source

In my case, the problem was a non-ascii username.

Find the pgAdmin installation and open / create config_local.py in the editor, add this:

 DATA_DIR = "C:/Data/pgAdmin" # set non-ascii path here 

and run setup.py using the python interpreter.

+1
source

In my config_distro.py this line was missing:

 MINIFY_HTML=False 

I added it the same way as in the steps above and it works

+1
source

In my case, SERVER_MODE was already False in config_distro.py. Then I started running pgadmin4 as an administrator. That didn't work either. Finally, I solved this by restarting the postgresql service in services.msc. restart postgres service

0
source

Source: https://habr.com/ru/post/1258323/


All Articles