Createdb Database Creation Failed Error Permission Denied To Create Database
Contents |
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 postgres grant user permission to create database the company Business Learn more about hiring developers or posting ads with us Super database creation error: permission denied to create database odoo User Questions Tags Users Badges Unanswered Ask Question _ Super User is a question and answer site for computer enthusiasts and power permission denied to create role postgres users. 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 rise to the top User permissions for creating
Permission Denied For Tablespace Pg_default
PostgreSQL DB up vote 13 down vote favorite 6 I'm working on Ubuntu. Following is one of my commands. $ psql -U kuser -d postgres Then this connects to the database. But from postgres terminal when i try postgres=> CREATE DATABASE kdb; ERROR: permission denied to create database When I try a similar command in Ubuntu, it gives the following $ sudo -u kuser createdb kdb sudo: unknown user: kuser sudo: unable to permission denied to create extension "postgis" initialize policy plugin How do I create this DB?. I have sudo rights and kuser is not me. postgresql share|improve this question edited Nov 19 '12 at 15:19 qqx 1,863711 asked Nov 19 '12 at 15:03 dinesh707 175114 add a comment| 1 Answer 1 active oldest votes up vote 28 down vote accepted It appears that you have a database user named kuser, but there is no system user with that name. This is why you're able to get a postgres prompt as that user, but sudo fails. That user isn't able to create a database, because that account doesn't have the necessary permission. You can either grant that permission to the user, using the postgres account which is the default management account on Ubuntu: sudo -u postgres psql -c 'alter user kuser with createdb' postgres Or you can just use that management account to create the database, and specify that it is owned by the kuser account: sudo -u postgres createdb -O kuser kdb If that user isn't going to be creating other databases I'd advise using the latter option, better to limit the privileges that are granted to the account. share|improve this answer answered Nov 19 '12 at 15:25 qqx 1,863711 add a comment| You must log in to answer this question. Not the an
pgsql-announce pgsql-bugs pgsql-docs pgsql-general pgsql-interfaces pgsql-jobs pgsql-novice pgsql-performance pgsql-php pgsql-sql pgsql-students Developer lists Regional lists Associations User groups Project lists Inactive lists IRC permission denied to create extension "hstore" Local User Groups Featured Users International Sites Propaganda Resources Weekly News
Permission Denied To Create Database Rails
Permission denied to create database From: Kevin Murphy
Alter User Postgresql
database Date: 2007-05-04 13:06:14 Message-ID: 463B2FC6.6050403@speakeasy.net (view raw or whole thread) Thread: 2007-05-04 13:06:14 from Kevin Murphy
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the http://stackoverflow.com/questions/28116927/postgres-permission-denied-to-create-database-on-rake-dbcreateall workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join permission denied them; it only takes a minute: Sign up Postgres permission denied to create database on rake db:create:all up vote 9 down vote favorite 1 I am trying to create postgres databases for development and tests. I'm using... OSX Yosemite Rails version: 4.2.0 git version: 2.2.2 psql version: 9.4.0 ruby version: 2.1.0p0 HomeBrew version: 0.9.5 Gemfile... gem 'pg' database.yml default: permission denied to &default adapter: postgresql encoding: unicode pool: 5 development: <<: *default database: myapp_development username: username password: test: <<: *default database: myapp_test rake db:create:all returns PG::InsufficientPrivilege: ERROR: permission denied to create database : CREATE DATABASE "myapp_development" ENCODING = 'unicode' .... (lots of tracing) Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"myapp_development", "username"=>"username", "password"=>nil} myapp_test already exists What is wrong? EDIT I just tried changing the username in the database.yml to my username that I'm using on my Mac. It worked. It also told me that not only maybe_test' already exists, but it also just told me thatmyapp_development` already exists too. Why wouldn't it be able to use the other username that I had created and assigned a role to CREATEDB? Why did it say that the development couldn't be created then tell me that it already existed? This all seems way too confusing and reminds me of php setup with apache back in the very old days. I don't want to have to deal with problems every time I create a new app and try to f