The single-quotes ( ‘ ‘ ) are not part of the password, but must enclose it. Note the required trailing semicolon ( ) at the end of the SQL statement. Next, connected with the psql client, we’ll create a role with our desired rolename that has the LOGIN attribute and our desired password, and that can create databases and manage roles ( N/B: Please do not type this postgres=#, since it's a placeholder): postgres=# create role rolename with createdb login password 'password1' Welcome to psql 10.6, the PostgreSQL interactive terminal. Next, connect to the database server using the psql client, as the postgres role: psql -U postgres ![]() To solve this simply follow the solution belowįirst, we need to login to the postgres user account via the command line interface sudo su - postgres PG::ConnectionBad: FATAL: role "promisepreston" does not exist Please check your configuration.ĪctiveRecord::NoDatabaseError: FATAL: role I got the following error messages below FATAL: role "promisepreston" does not existĬouldn't create 'MyBlog_development' database. I ran into similar issues when setting a new Rails application with Postgresql. Removed RoR tag, and still looking for answers from Postgres gurus on why the role issue persists :) So the problem appears to be with my local machine but not the app itself. I just uninstalled the app, reinstalled it using SQLite (yucks), ran the local server and got the test landing page to show up. This is most certainly a pg issue, not a rails issue. Which perhaps suggests to me that it's an system issue, and not a Rails issue at all? It opened the Terminal, ran a command ( '/Applications/Postgres.app/Contents/Versions/9.5/bin'/psql -p5432) and then gave me the same error ( psql: FATAL: role "MyProfile" does not exist). If a file doesnt open with this command (a file that already has settings in it) then youll need to explore around /etc/postgresql to find the nf file. I just opened the Postgres App and clicked the "Open psql" button. replace vim with your choice of text editor. But the psql command still returns that the role does not exist. ![]() I've also run ps aux | grep postgres and it looks like all the PID's that are associated with anything postgres are running under "MyProfile" (assuming I'm reading it right). Variations of sudo -u postgres createuser owning_userĪnd a couple other commands in an effort to create this roll/user, but I can't seem to get done what I need to to resolve the issue. Am I missing an obvious step here/doing something wrong? So far I've been following Heroku's instal process and am stuck here (or more accurately here, after the installation, where Heroku says that running psql -h localhost should work). When I run even just psql I, again, get the error FATAL: role "MyProfile" does not exist. I gather from the dozens of other questions on this topic that I need to switch to, or create the "M圜omputer" role, however I've noticed that they all require using the psql command. For more info, make sure to review the PostgreSQL documentation.I'm setting up Postgresql for use with a Rails app, but I do not seem to be able to connect to, or properly configure, the database (the errors I get after starting the Rails server are: ActiveRecord::NoDatabaseError and could not translate host name "MyProfile" to address: nodename nor servname provided, or not known). Hopefully that's enough to get you started. To get help for other commands in psql, type the command \?.If a user exists, but it's not a superuser, you can change that with the command alter user maniesha superuser. Make sure the postgres user have admin permissions by providing the -superuser operator. ![]() So, let’s try to create it with the createuser command installed together with postgres. As I mentioned the database seems to be working but no one wants a repeating FATAL error message in his logs -) What is the reason for this behavior And how can I fix it Thanks for any help. According to the message, there’s no user named postgres in the DB. If no user with your name exists, create a user with the command create user maniesha superuser. There is no cron job in this container for PostgreSQL. If no database with your name exists, type create database maniesha (don't forget the semicolon).Then list all databases with the command \l (backslash-ell).Connect to PostgreSQL with the user postgres like this: psql -U postgres. ![]() Secondly, it could be that Postgres.app failed to create a user with your name. 81790 ? S 0:01.44 /Applications/Postgres.app/Contents/Versions/11/bin/postgres -D /Users/jakob/Library/Application Support/Postgres/var-11 -p 5432Ĩ1792 ? Ss 0:00.03 postgres: checkpointerĨ1793 ? Ss 0:00.30 postgres: background writerĨ1795 ? Ss 0:01.31 postgres: autovacuum launcherĨ1796 ? Ss 0:04.23 postgres: stats collectorĨ1797 ? Ss 0:00.02 postgres: logical replication launcherįrom the first line you can see which version of PostgreSQL is running, and if the data directory is what you expect.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |