I am following the tutorial https://www.digitalocean.com/community/tutorials/how-to-install-configure-pgadmin4-server-mode
It is outdated unfortunately and while I managed to correct the command of setup.py into python setup.py add-user --admin mymail@mail.com mypass I get an error that the pgadmin4.db has not been created. The installation process does create the sessions and the storage directories but never the database pgadmin4.db
so when it is going to read the file config_local dot py:
LOG_FILE = '/var/log/pgadmin4/pgadmin4.log'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
SERVER_MODE = True
it complains that the pgadmin4.db does not exist
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
After installing pgAdmin and setting your configuration (like
config_local.py
), you must manually trigger the database initialization usingpython setup.py
.But first, ensure the required paths and permissions are set properly. From the pgAdmin installation directory (e.g.,
/usr/pgadmin4/web/
or wherever it was extracted), run:Alternatively, if you already provided them using
add-user
, the regularsetup.py
call is still required to trigger the initial DB setup.After that, confirm the database file is created:
Now you should be able to run
python pgAdmin4.py
. If you’re using a Python virtual environment, make sure you’re in it when running the above commands.Heya, @977ef09003a542a28c2984affdd220
You can run
python setup.py
from the pgAdmin install directory to initialize the DB — even if you’ve already added a user. Make sure directories inconfig_local.py
exist and are writable.After that,
pgadmin4.db
should be created andpython pgAdmin4.py
will work.Let us know how it goes