PostgreSQL: Show all the privileges for a concrete user

table permissions: select * from information_schema.role_table_grants where grantee=”YOUR_USER” ; ownership: select * from pg_tables where tableowner=”YOUR_USER” ; schema permissions: select r.usename as grantor, e.usename as grantee, nspname, privilege_type, is_grantable from pg_namespace join lateral ( SELECT * from aclexplode(nspacl) as x ) a on true join pg_user e on a.grantee = e.usesysid join pg_user r on … Read more

What registry access can you get without Administrator privileges?

In general, a non-administrator user has this access to the registry: Read/Write to: HKEY_CURRENT_USER Read Only: HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT (which is just a link to HKEY_LOCAL_MACHINE\Software\Classes) It is possible to change some of these permissions on a key-by-key basis, but it’s extremely rare. You should not have to worry about that. For your purposes, your application … Read more

Remove privileges from MySQL database

The USAGE-privilege in mysql simply means that there are no privileges for the user ‘phpadmin’@’localhost’ defined on global level *.*. Additionally the same user has ALL-privilege on database phpmyadmin phpadmin.*. So if you want to remove all the privileges and start totally from scratch do the following: Revoke all privileges on database level: REVOKE ALL … Read more

How to start MySQL with –skip-grant-tables?

I had the same problem as the title of this question, so incase anyone else googles upon this question and wants to start MySql in ‘skip-grant-tables’ mode on Windows, here is what I did. Stop the MySQL service through Administrator tools, Services. Modify the my.ini configuration file (assuming default paths) C:\Program Files\MySQL\MySQL Server 5.5\my.ini or … Read more

How do I get column datatype in Oracle with PL-SQL with low privileges?

ALL_TAB_COLUMNS should be queryable from PL/SQL. DESC is a SQL*Plus command. SQL> desc all_tab_columns; Name Null? Type —————————————– ——– —————————- OWNER NOT NULL VARCHAR2(30) TABLE_NAME NOT NULL VARCHAR2(30) COLUMN_NAME NOT NULL VARCHAR2(30) DATA_TYPE VARCHAR2(106) DATA_TYPE_MOD VARCHAR2(3) DATA_TYPE_OWNER VARCHAR2(30) DATA_LENGTH NOT NULL NUMBER DATA_PRECISION NUMBER DATA_SCALE NUMBER NULLABLE VARCHAR2(1) COLUMN_ID NUMBER DEFAULT_LENGTH NUMBER DATA_DEFAULT LONG NUM_DISTINCT … Read more

What is the best way for checking if the user of a script has root-like privileges?

os.geteuid gets the effective user id, which is exactly what you want, so I can’t think of any better way to perform such a check. The one bit that’s uncertain is that “root-like’ in the title: your code checks for exactly root, no “like” about it, and indeed I wouldn’t know what “root-like but not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)