Hot answers tagged

189 votes

List the database privileges using psql

You can do that by following: SELECT grantee, privilege_type FROM information_schema.role_table_grants WHERE table_name='mytable' This gives you this kind of output: mail=# select grantee, ...
Himanshu Chauhan's user avatar
44 votes

List the database privileges using psql

Undercovers psql uses the bellow query when you issue \du command. SELECT r.rolname, r.rolsuper, r.rolinherit, r.rolcreaterole, r.rolcreatedb, r.rolcanlogin, r.rolconnlimit, r.rolvaliduntil, ...
Denys's user avatar
  • 553
43 votes

List the database privileges using psql

Using psql meta-commands: https://www.postgresql.org/docs/current/static/app-psql.html Going over the page with Ctrl+F gives: \ddp [ pattern ] Lists default access privilege settings. \dp [...
Vao Tsun's user avatar
  • 1,193
33 votes
Accepted

How to Install postgresql-client-11 on Ubuntu 18.04

Install it from PostgreSQL's own apt repository, adapted from these instructions. sudo apt-get install curl ca-certificates gnupg curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-...
jjanes's user avatar
  • 39.4k
29 votes

List the database privileges using psql

This is how you can list all privileges of a role (grantee): SELECT grantor, grantee, table_schema, table_name, privilege_type FROM information_schema.table_privileges WHERE grantee = 'myuser' Will ...
Markofo's user avatar
  • 391
26 votes

How do I access Postgres when I get an error about "/var/run/postgresql/.s.PGSQL.5432"?

If your Postgres service is up and running without any error or there is no error in starting the Postgres service and still you are getting the mentioned error, follow these steps Step1: Running ...
Noushad's user avatar
  • 361
24 votes
Accepted

How do I totally remove SQL Server 2017 on Ubuntu?

These are actually very poor instructions on how to remove the Microsoft SQL Server. SQL Server installs these associated packages. mssql-server mssql-server-fts mssql-tools msodbcsql unixodbc-dev ...
Evan Carroll's user avatar
  • 62.7k
23 votes

"ORA-24454: client host name is not set" when connecting from Ubuntu instance on AWS EC2

After two hours, I figured it out. Oracle's documentation for the error didn't seem terribly descriptive at first: ORA-24454: client host name is not set Cause: The network host name in files like /...
Karl Johnson's user avatar
22 votes
Accepted

Command not found: pg_ctl on Ubuntu

pg_ctl by design isn't in the path of the version of PostgreSQL Debian (and therefore Ubuntu) distributes. PostgreSQL is installed as a service in Debian/Ubuntu sudo service postgresql {start|stop|...
Evan Carroll's user avatar
  • 62.7k
20 votes
Accepted

How do I disable MySQL on Linux from starting on boot or statup?

MariaDB use systemd as does MySQL. To disable MySQL or MariaDB, from starting on bootup, run systemctl list-unit-files '*mariadb*' '*mysql*' If you see mysql.service, try disabling that one first. ...
Evan Carroll's user avatar
  • 62.7k
17 votes

How do I access Postgres when I get an error about "/var/run/postgresql/.s.PGSQL.5432"?

You probably have multiple PostgreSQL versions installed. If so, the other version probably defaults to unix_socket_directories = '/tmp/' but the libpq your psql is linked to probably defaults to /var/...
Craig Ringer's user avatar
  • 56.1k
16 votes

List the database privileges using psql

This is my query composed of multiple answers on this question: SELECT grantee AS user, CONCAT(table_schema, '.', table_name) AS table, CASE WHEN COUNT(privilege_type) = 7 THEN 'ALL' ...
stefannienhuis's user avatar
16 votes
Accepted

Getting "sqlcmd sqlcmd: command not found" in Linux?

First make sure you've installed mssql-tools. Assuming you've done that, there are two methods of resolving this. User-specific method advocated in the manual: add the directory to the environmental ...
Evan Carroll's user avatar
  • 62.7k
15 votes

How to connect to SQL Server using sqlcmd on Linux?

With the help of Dan Guzman's comment I got the connection working using a port. I had a Windows machine with SQL Management Studio connected to the database in question, and used: netstat -abn ...
geographika's user avatar
15 votes
Accepted

MySQL SSL error: Unable to get private key

Ok, apparently just changing 'BEGIN PRIVATE KEY' to 'BEGIN RSA PRIVATE KEY' isn't enough. It must be properly converted from PKCS#8 to PKCS#1 Reference openssl rsa -in /etc/mysql/ssl/nginx.key -out ~...
Velkan's user avatar
  • 411
14 votes

How to make MySQL table name case insensitive in Ubuntu?

If you change lower_case_table_names in a DB with existing tables Stack Overflow: MySQL > Table doesn't exist. But it does (or it should) can happen. The comment to this answer helped me in this ...
Gerold Broser's user avatar
14 votes

List the database privileges using psql

A (possibly obvious) additional step is become the postgres user, otherwise you may get errors about roles not existing. sudo su - postgres psql -l or psql postgres=> \l
Adam Shostack's user avatar
14 votes
Accepted

PgAdmin 4 installation on Debian/Ubuntu

There are instructions on the pgAdmin site how to install with pip: https://www.pgadmin.org/download/pip4.php But there is no official Debian Package (.deb), yet. A request for packaging is pending: ...
Erwin Brandstetter's user avatar
14 votes
Accepted

How do I access Postgres when I get an error about "/var/run/postgresql/.s.PGSQL.5432"?

psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? This error ...
Daniel Vérité's user avatar
14 votes

How to uninstall pgAdmin4 on Ubuntu 16.04?

sudo apt autoremove pgadmin4 works for ubuntu version 18.04
Sarath Rajan's user avatar
14 votes

Mysql could not be started because unknown variable 'log-syslog=1'

I've run into the same problem as yourself and found this question while looking for solution. Eventually I found the culprit. You will find that /etc/mysql/mysql.conf.d/mysqld_safe_syslog.cnf ...
Vorta's user avatar
  • 141
13 votes
Accepted

How to check the syntax of pg_hba.conf and other postgresql conf files on ubuntu/debian/linux?

You can run: postgres=# SELECT pg_reload_conf(); pg_reload_conf ---------------- t (1 row) postgres=# .. from within psql. or kill -HUP the postmaster process. Any config validation errors will ...
Philᵀᴹ's user avatar
  • 31.7k
13 votes
Accepted

Unable to start SQL Server on Ubuntu 16.04

SQL Server did not start because the OS did not have 3250MB of memory. Was tracked by below command journalctl -u mssql-server.service -b Nov 30 00:43:21 OraServer sqlservr[4075]: sqlservr: This ...
Rak's user avatar
  • 417
13 votes

Is there a developer edition of Microsoft SQL Server 2017 for Linux?

2017, May: SQL Server 2017 hasn't been released yet (only previews) so no licensing or pricing is available yet (the name v.Next should have been a clue!). 2017, Dec: SQL Server 2017 for Linux was ...
Brent Ozar's user avatar
  • 42.9k
13 votes
Accepted

psql gives Invalid data directory error

Error: Invalid data directory This happens when pg_wrapper is unable to figure out the data directory from the configuration. pg_wrapper is the layer on top of postgres that can juggle between ...
Daniel Vérité's user avatar
13 votes
Accepted

CPU Usage Incorrect in sys.dm_os_ring_buffers

Microsoft says that DMV (ring buffers) doesn't work on SQL Server 2017, only 2019: Sys.dm_os_ring_buffers DMV has been a key DMV used for monitoring SQL Server by built-in tools as well as third ...
Brent Ozar's user avatar
  • 42.9k
10 votes
Accepted

AttributeError: 'NoneType' object has no attribute 'value' - pgAdmin4

I performed the same steps and ran into the same problem. I found that the problem was resolved by removing the ~/.pgadmin directory (created during installation) and then re-running "python pgAdmin4....
Dowwie's user avatar
  • 216
10 votes
Accepted

mssql-service error exit with status 255 ubuntu

Seems like the only solution is downgrading: On a Ubuntu server do the following to perform a downgrade to the previous (14.0.3022.28-2) version: systemctl stop mssql-server sudo apt-get install mssql-...
Felix K.'s user avatar
  • 216
10 votes

My disk is full of binlog files

With MySQL8, they have turned on binary logging by default and the default purge (expiry/deletion) of binary logs is set to 30days. Once you are in your SSH and in mysql, you can use the below ...
verge's user avatar
  • 201
9 votes
Accepted

postgresql 10 for Ubuntu 17.10 artful?

I have replaced artful-pgdg with zesty-pgdg in /etc/apt/sources.list.d/pgdg.list and it worked for me https://wiki.postgresql.org/wiki/Apt/FAQ I am using a non-LTS release of Ubuntu Non-LTS ...
5w0rdf1sh's user avatar
  • 218

Only top scored, non community-wiki answers of a minimum length are eligible