简体   繁体   中英

FATAL: role “postgres” does not exist; I can see postgreSQL running and can use psql to connect to tables

I've seen similar issues posted on here but I can't solve my problem. I've had postgres working for a month and last night it stopped working. I can use psql in the command line to access databases and tables. When I connect to localhost and can view a page I've built. When I try to log in I believe it's the first time using psql and I get an error page with the FATAL message mentioned above. When I open Postgres from spotlight I get the message "There is already a PostgreSQL server running on port 5432". I also see the mssage "Server startup failed" and "You now have a PostgreSQL server running locally." It appears postgres is working, but I don't know why out of the blue I'd get this FATAL message on my localhost9292. Any suggestions/clarification? Thanks

Perhaps the operating system user you are connecting as doesn't have an account in Postgres. Try this: psql -U postgres

Update: current working theory - there is more than 1 Postgres install on the machine, and the default installed one has started instead of the user installed one. That would explain why this was working before, and now does not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM