W
Wasp7mo ago
Sven

how to connect to fly database using pgadmin?

i try to connect to my fly db using pgadmin 4, i proxy my database with: fly proxy 5432 -a <app> then i fill in these in pgadmin under add server: host: localhost username: postgres password: XXXX then i says "... has no attribute servermanager". What are the concrete steps to take to connect?
4 Replies
kapa.ai
kapa.ai7mo ago
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To connect to your Fly.io Postgres database using pgAdmin, the general approach you described is correct: 1. Start the proxy to your Fly database:
fly proxy 5432 -a <your-db-app-name>

fly proxy 5432 -a <your-db-app-name>

This will forward your Fly Postgres database to your local machine on port 5432. 2. In pgAdmin, add a new server with these settings: - Host: localhost - Port: 5432 - Username: postgres (or whatever your DB user is) - Password: (your Fly Postgres password) - Database: (the name of your database, which you can find using fly postgres connect -a <your-db-app-name> and then running \l in the psql prompt) This is confirmed by community guidance: "If you instead used wasp db start to have Wasp run a Postgres dev database for you, you can see the URL connection being printed at the very start of wasp db start output -> and again, you can use that to connect to that postgres db via pgadmin." The same principle applies when using fly proxy to expose your Fly Postgres instance locally: you connect to localhost:5432 with the correct credentials in pgAdmin. The credentials are the same as those you use in your Wasp app's DATABASE_URL for production or development, depending on which database you're connecting to. If you are unsure of the credentials, you can retrieve them as described in the docs and issues (Discord support thread: Accesing the database in pgAdmin, Github Issue: Update the database docs on seeding the production DB on Fly). Troubleshooting - The error message ... has no attribute servermanager is not a standard Postgres or Fly error; it may be a pgAdmin bug or installation issue. Try restarting pgAdmin, or reinstalling it if the problem persists. - Make sure nothing else is running on port 5432 locally (such as another Postgres instance), as this will prevent the proxy from working correctly (Github Issue: Update the database docs on seeding the production DB on Fly). - Double-check your credentials (username, password, database name). If you follow these steps and still encounter the same error, it is likely an issue with your pgAdmin installation rather than with the connection process itself. The knowledge sources do not provide more specific troubleshooting for the servermanager error, so for that, you may need to consult pgAdmin's own documentation or support channels. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Sven, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Sven
SvenOP7mo ago
doesnt work
Sven
SvenOP7mo ago
No description
toticozeni
toticozeni7mo ago
Hey @Sven it might be due to version mismatch between postgres and pgAdmin. Certain versions of pgAdmin only support certain versions of postgres as it's internal change. Please check that they indeed support each other. Let me know if there is still issues after.

Did you find this page helpful?