Postgresql Error Database Does Not Exist
Contents |
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business database does not exist sql server Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users psql: fatal: database "user" does not exist Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve createdb: database creation failed: error: permission denied to create database their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and sudo: unknown user: postgres rise to the top ERROR: database “dbname” does not exist up vote 9 down vote favorite 3 According to the documentation, so long as I'm not connected to a database, I can either delete a database in the console using: DROP DATABASE dbname; Or I can drop it using the wrapper tool dropdb. Both give me an error saying the database doesn't exist, yet when in the console and typing the command \l, I get a
Fatal: Role "postgres" Does Not Exist
list of databases including the one I want to delete. List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---------------------------+-----------+----------+-------------+-------------+----------------------- Blog_development | myusername | UTF8 | en_US.UTF-8 | en_US.UTF-8 | Blog_test | myusername | UTF8 | en_US.UTF-8 | en_US.UTF-8 | The database name is Blog_development (and the one below it). I was playing with rails and trying to learn from the online documentation. I wanted to start over and delete everything. When trying to delete it however, it says it doesn't exist. I'm brand new to PostgreSQL so I'm a bit lost, nothing in the documentation about this error other than it popping up when it doesn't exist. Of course it exists, it's right there. postgresql share|improve this question edited Dec 27 '12 at 2:33 Craig Ringer 28.3k14083 asked Dec 26 '12 at 21:03 Sephethus 15513 2 Please always show the full, exact text of any error messages, and show your PostgreSQL version. –Craig Ringer Dec 27 '12 at 2:34 Check the port your DB is running on. The tools such as dropdb, createdb etc will connect by default to 5432. This caught me out when my DB was actually running on 5433. –user35738 Mar 17 '14 at 11:32 add a comment| 1 Answer 1 active oldest votes up vote 15 down vote accepted Your
8.1 / 8.2 / 8.3 / 8.4 / 9.0 PostgreSQL 8.2.23 Documentation Prev Fast Backward Chapter 1. Getting Started Fast Forward Next 1.3. Creating a Database
Pg::insufficientprivilege: Error: Permission Denied To Create Database
The first test to see whether you can access the database server is to fatal: database does not exist rails try to create a database. A running PostgreSQL server can manage many databases. Typically, a separate database is used for how to exit psql each project or for each user. Possibly, your site administrator has already created a database for your use. He should have told you what the name of your database is. In that case you http://dba.stackexchange.com/questions/31059/error-database-dbname-does-not-exist can omit this step and skip ahead to the next section. To create a new database, in this example named mydb, you use the following command: $ createdb mydb This should produce as response: CREATE DATABASE If so, this step was successful and you can skip over the remainder of this section. If you see a message similar to createdb: command not found then PostgreSQL was not https://www.postgresql.org/docs/8.2/static/tutorial-createdb.html installed properly. Either it was not installed at all or the search path was not set correctly. Try calling the command with an absolute path instead: $ /usr/local/pgsql/bin/createdb mydb The path at your site might be different. Contact your site administrator or check back in the installation instructions to correct the situation. Another response could be this: createdb: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? This means that the server was not started, or it was not started where createdb expected it. Again, check the installation instructions or consult the administrator. Another response could be this: createdb: could not connect to database postgres: FATAL: role "joe" does not exist where your own login name is mentioned. This will happen if the administrator has not created a PostgreSQL user account for you. (PostgreSQL user accounts are distinct from operating system user accounts.) If you are the administrator, see Chapter 18 for help creating accounts. You will need to become the operating system user under which PostgreSQL was installed (usually postgres) to create the first user account. It could also b
Sign in Pricing Blog Support Search GitHub This repository Watch 55 Star https://github.com/strongloop/loopback-connector-postgresql/issues/46 48 Fork 67 strongloop/loopback-connector-postgresql Code Issues 41 Pull requests 9 http://www.revsys.com/blog/2007/may/16/common-postgresql-problem/ Projects 0 Pulse Graphs New issue Connector attempts to connect to a database named after my Windows username #46 Closed a-type opened this Issue Dec 16, 2014 · 8 comments Projects None yet Labels None yet Milestone does not No milestone Assignees No one assigned 4 participants a-type commented Dec 16, 2014 Recently decided to give StrongLoop development a shot on my Windows machine. I understand that being NodeJS doesn't necessarily imply Windows support in reality, nor is Windows generally a high compatibility target. Still thought does not exist I'd drop a line here before perhaps switching back to Linux for development. When I attempt to run a server, I get this output: Connection fails: { [error: database "Grant" does not exist] name: 'error', length: 83, severity: 'FATAL', code: '3D000', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, file: 'postinit.c', line: '775', routine: 'InitPostgres' } It will be retried for the next request. events.js:72 throw er; // Unhandled 'error' event ^ error: database "Grant" does not exist at Connection.parseE (C:\Users\Grant\Documents\Git\current\node_modules\loopback-connector-postgresql\node_modules\pg\lib\connection.js:534:11) at Connection.parseMessage (C:\Users\Grant\Documents\Git\current\node_modules\loopback-connector-postgresql\node_modules\pg\lib\connection.js:361:17) at Socket.
about it. This problem trips up so many new users it might even be worth changing the default error message to indicate what is going on. The error message happens when the user tries to run psql for the first time: psql: FATAL: database "root" does not exist Where "root" is the current Unix username of the operator. By default PostgreSQL attempts to log you into a database that is the same as your username. However, it does not setup this database for you because it would be silly to setup 500 databases for all of the Unix users on your system, if only two of them are going to be using PostgreSQL. When setting up PostgreSQL for the first time you need to do the following: su ( or otherwise ) become your root user su ( or otherwise ) become your PostgreSQL user, typically 'postgres' Create your first database The ultimate goal here is to become your PostgreSQL user, typically this involves becoming root and then switching to user postgres. Upon setup this is the only user that is allowed to create users and databases. Your "first" database can be created in one of two ways: Run the command 'psql template1' followed by a 'CREATE DATABASE' SQL call Run the command 'createdb