failing to grant privileges in mysql pythonanywhere - pythonanywhere

I am trying to run
GRANT ALL ON *.* TO 'username'#'username.mysql.pythonanywhere-services.com';
but its not working
Try to give insert permission to current mysql user

Related

Q: How to grant analyze privileges to pghero user

I've successfully setup pgHero using the permissions guide here.
Everything is working, including historical query stats, except for the ability run analyze on queries that it shows are slow.
I get PG::InsufficientPrivilege: ERROR: permission denied for table <tableName>
How can I grant permission to analyze to the pghero user?
Turns out this is as simple as granting SELECT (and whatever other) privileges to the pghero user like so:
# Grant select access for all current tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO pghero;
# For all future tables
ALTER DEFAULT PRIVILEGES FOR ROLE <main-user> IN SCHEMA public GRANT SELECT ON TABLES TO pghero;

user not allowed to perform grant operations

I granted connect permissions to an user on a database:
$ db2 grant connect on database to user dbuser
DB20000I The SQL command completed successfully.
but when I try to grant select permissions or dbadm it gives me an error saying the user doesn't have grant permissions, but i am using for connect, select and dbam
$ db2 grant dbadm on database to user dbuser
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0552N "TSSADM" does not have the privilege to perform operation "GRANT".
SQLSTATE=42502
According to the GRANT (database authorities) statement, your user have to have SECADM authority in the database to have an ability to grant DBADM. Does your user have such an authority?

Amazon RDS - Postgresql role cannot access tables

created a postgresql instance on AWS with the username ziggy. I restored a database to that instance. however I cannot even select any of the tables
select * FROM mac_childcare_parcels
gives me ERROR: permission denied for relation mac_childcare_parcels
********** Error **********
the owner of that table belongs to the postgres login.
so i tried running this: grant all privileges on all tables in schema public to ziggy but since I am not a superuser I cannot give myself privileges so that throws a permissions error. what do I have to do to get access to the tables?
this does not work either
grant select on mac_childcare_parcels to ziggy
this query returns successful but does not let the login ziggy access the tables
GRANT USAGE ON SCHEMA public TO ziggy;
First login with superuser and provide all rds superuser access to the newly created user using a command like below
GRANT rds_superuser TO ziggy;
replace rds_superuser with your rds superuser.
You need to also GRANT USAGE on the SCHEMA, e.g.
GRANT USAGE ON SCHEMA public TO ziggy;
The superuser access is needed to run the access level queries. But as you said that access is not present then i would say copy the replica of the db which you have restored from backup and grant yourself as superuser.
then provide all needed access to any users.

Why can I not set permissions on fresh install of PostgreSQL

A fresh installation of PostgreSQL 9.3 (according to the YUM Installation manual on the PostgreSQL wiki) on CentOS 6 (64-bit) will not grant permissions to any users.
I log in to the postgres user and open psql, then I create a role for my default user:
CREATE ROLE <name> WITH PASSWORD '<password>';
and then try to grant it privileges on the default postgres database:
GRANT ALL ON DATABASE postgres TO <user>;
which gives the expected output, but the user does not have any permissions on postgres.
The output of \dp <user> is quizically empty as well. Additional testing shows that I cannot give any users permissions. However, when I try to drop a role that has been granted these nonexistent permissions, it says
ERROR: role "<user>" cannot be dropped because some objects depend on it
DETAIL: privileges for database postgres
I am at a loss. I did also check to make sure the postgres Linux user has the appropriate file permissions on the PostgreSQL data directory.
Presumably you're expecting too much of GRANT ALL ON DATABASE postgres TO <user>;
ALL in this context means that the command is equivalent to:
GRANT CREATE,CONNECT,TEMPORARY ON DATABASE postgres TO <user>;
And the way you create the ROLE, it cannot login to any database anyway (you can check this with \du).
It could if it was created with:
CREATE ROLE name WITH LOGIN PASSWORD 'pass';
or use ALTER ROLE name WITH LOGIN later on.
Starting from this, to give the user permissions to create objects in the database, other forms of GRANT should be used.

Postgresql Won't grant user access to database that is existent

I'd puzzled, being a newbie to postgresql.
I have a database named "Launch"
I'm running:
GRANT ALL PRIVILEGES ON DATABASE Launch TO admin;
user admin has privileges like:
Additionally, running postgres command:
\list
yields the database "Launch"
The only thing I did see was, there was no entry for "Access Privileges" for the database Launch:
What am I doing wrong here?
Lesson learned the long way:
GRANT ALL PRIVILEGES ON DATABASE <yourdbhere> TO <youruserhere>;
the <yourdbhere> the db name MUST be in lower case. By using Launch for my db name - it was messing things up.