Creating new database object on DBeaver - ERROR: permission denied to create database - dbeaver

Probably basic stuff. I'm just trying out DBeaver for the first time to set up a Postgresql database.
I chose new database connection - Postgres
Host: localhost
Database: postgres
Username: postgres and system password ... All connected
but when I right click create new database or schema I get the error
"SQL Error [42501]: ERROR: permission denied to create database
ERROR: permission denied to create database"
Where could I be doing wrong?

User postgres don't have Create Database permission.
You can check list of given permissions from Roles->postgres
Note: By default Super User will have all the permissions but if your's is not Super User then you have to establish connection using Super User and then enable required permissions to Non Super User.

I am using Ubuntu OS. In my case was an issue when trying to save a DUMP on SSD. I solved by following steps:
1st - open ubuntu software
2nd - search for dbeaver-ce
3rd - after installed it, click Permissions
4th - check Read/write files on removable storage devices
Hope it might help someone in the future.

I tried to do the same over several hours yesterday. Apparently, DBeaver doesn't allow the creation of new databases (at least at this version of the software). You can connect to an existing DB and that's about it.

Related

Cannot connect to https://api.elephantsql.com from pg admin

has anyone success to create connection to elephantsql.org using pgadmin?
i want to try to store my database on a server and im trying to use elephantsqlcom
i want to connect to it using pg admin to make maintenance easier. i have followed this instruction : https://www.elephantsql.com/docs/pgadmin.html but keep getting this error
what should i do? thanks all
change database name from postgres to xwpgagbb similar to:
see user AND DEFAULT DATABASE are the same?..

What can cause "Access to database is denied by server administrator"

A few days ago I started working with firebird on opensuse. When I try open the database by using monodevelop(C#), I get the error message:
"access to database is denied by server administrator"
How can I solve this?
I am using firebird 2,5, opensuse 13.1, and monodevelop.
You are trying to access a database in a location that is not allowed by the server configuration. There are two potential causes:
The value(s) of DatabaseAccess in firebird.conf do not include or explicitly deny the current location of the database.
To fix this you either need to configure an alias and use the alias to connect, move the database to one of the allowed folders, or add an additional location to the configuration entry
the firebird user (the user running the server process) does not have access to the database file.
To fix this you need to make sure that the firebird user of the server process (if connecting through the Firebird server), or your own user (if using embedded) has sufficient access rights to the database.
See also http://www.firebirdfaq.org/faq39/ and http://ibexpert.net/ibe/index.php?n=Doc.ConfiguringFirebird#DatabaseAccess

Can't connect to local Firebird with ISQL

I'm trying to setup a local firebird instance to test against but am unable to connect to it with even ISQL. I have tried to following by following the quick start guide here:
CONNECT ..\examples\empbuild\employee.fdb user SYSDBA password masterkey;
Which resulted in:
Statement failed, SQLSTATE = 08001
unavailable database
After some searching I tried modifying that to:
CONNECT "localhost:C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\employee.fdb" user SYSDBA password masterkey;
Which resulted in:
Statement failed, SQLSTATE = 28000
cannot attach to password database
After confirming I had the right directory path I decided to give on on connecting for now and try creating a new DB:
SQL>CREATE DATABASE 'C:\data\test.fdb' page_size 8192
CON>user 'SYSDBA' password 'masterkey';
Which also gave me the error:
Statement failed, SQLSTATE = 08001
unavailable database
Are there any common pitfalls I might be hitting? I've also tried the commands above both with and without the firebird service running. Also is there a detailed reference on the SQLSTATE codes?
As already mentioned in my comments the problem is caused by running the Firebird server as an application. Firebird has its password database (security2.fdb) in C:\Program Files\Firebird\Firebird_2_5. As this database is (almost, but not entirely) a normal Firebird database, the server requires write access to this database (for the transactions, etc).
By default (with UAC) users do not have write access to the password database, so this requires elevation to Administrator. So access to Firebird requires that you either run the application as a service with sufficient rights (eg as done by the default installer), or when running the server as application to run it 'As administrator'. Another option is to not install it in Program Files.
This BTW applies double when accessing the example employee database as this database file is also located in the Program Files folder.
This is for macOS/OSX (mine is 10.15) firebird ver 2.5 users.
The installation process here does not ask for a sysdba password. Which means: the security database 'security2.fdb' does not exist after a new installation.
This seems to be intentionally for security reasons since > ver 2.5.
To create one, we use the demo database as a helper:
open sql as su: >sudo isql (we don't have user rights on dir)
Connect to a existing db:
sql>connect
"/Library/Frameworks/Firebird.framework/Resources/examples/empbuild/employee.fdb
" user 'SYSDBA' password 'masterkey';
Now we created the missing file 'security2.fdb' in the folder:
"/Library/Frameworks/Firebird.framework/Resources/English.lproj/var/"
(jro)

DB2 Can't connect to db with new user

I have created a DB2 database, and I'm trying to create a new user.
Here the steps I made :
- Creating an OS (Linux) user with root account (useradd myuser)
- Giving a password to the new user (passwd myuser)
- On IBM Data Studio, I added a new user and grant him connect to the database
But on Linux, with the user which owns the instance, I tried to connect to the database with the new user (db2 connect to MYDB user myuser), I've the following :
SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR
PASSWORD INVALID"). SQLSTATE=08001
Am I doing something wrong ?
Thanks in advance for your help
The answer might depend on the DB2 version. Until DB2 9.7 fix pack 1 you could not have the password longer than 8 characters. And how long is the actual user name? I would limit that to 8 characters as well. The error is quite clear: the user authentication fails, and DB2 relies on the OS for authentication.

How to create a postgresql superuser without a superuser account?

OK...just installed Mountain Lion. First thing I noticed was that my Postgres user account was missing from the login screen. I then verified that my postgres installation was no longer working. So I created a new postgres user account on my Mac and set all the proper permission to get the postgres server to start. It started but immediately the server shutdown. I checked the log files and it said that role "postgres" does not exist.
I can't figure out how to create this user in the db since the db won't allow me to access it without using a superuser account. I tried "createuser postgres" but got the same message, "role 'postgres' does not exist". I don't know what to do at this point.
Found my problem. Somehow my postgres db user did get erased during the upgrade to mountain lion. I was able to log into the db using the same name that I use to log into the system however. Unfortunately, I found that my databases where also removed during the upgrade. I don't know why but the upgrade did effect my postgresql installation. After logging in, I found that the postgres db and the template1 db had no relations to be found. Now to piece my db back together...luckily I'm still in development mode. Note: In the future make db backups prior to upgrading system.