Hot answers tagged

154 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, ...
user avatar
61 votes

How to make MySQL table name case insensitive in Ubuntu?

Open terminal and edit /etc/mysql/my.cnf sudo nano /etc/mysql/my.cnf Underneath the [mysqld] section.add: lower_case_table_names = 1 Restart mysql sudo /etc/init.d/mysql restart Then check it ...
user avatar
35 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 [...
user avatar
  • 1,085
29 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-...
user avatar
  • 31.6k
26 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, ...
user avatar
  • 373
23 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 ...
user avatar
  • 55.7k
22 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 ...
user avatar
18 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 ...
user avatar
  • 281
17 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|...
user avatar
  • 55.7k
16 votes
Accepted

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

There are two methods of resolving this. User-specific method advocated in the manual: add the directory to the environmental variable PATH. System-wide method: symlink the executable to a directory ...
user avatar
  • 55.7k
16 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. ...
user avatar
  • 55.7k
14 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 ...
user avatar
  • 141
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: ...
user avatar
14 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/...
user avatar
  • 51.8k
13 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 ...
user avatar
13 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
user avatar
13 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 ...
user avatar
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 ...
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 ...
user avatar
  • 41.3k
13 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 ~...
user avatar
  • 341
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 ...
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 ...
user avatar
  • 41.3k
11 votes
Accepted

Difference between mongod and mongodb upstart jobs

I suspect you had MongoDB 2.4 installed previously. In MongoDB 2.4 the service was called mongodb and used /etc/mongodb.conf (ref: Install MongoDB 2.4 on Ubuntu). With MongoDB 2.6 there was an ...
user avatar
  • 9,770
11 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 ...
user avatar
10 votes
Accepted

Do I need to set tcpip_socket = true to allow remote connections to a postgresql database?

All you should need is: listen_addresses = '*' and then to modify pg_hba.conf to permit connections from the desired source. This is stated in the comments on the (very old) article you were ...
user avatar
  • 51.8k
10 votes

Redis takes up all the Memory and Crashes

Use the maxmemory to set a limit to how much your Redis database can grow too. Failing to do so, Redis will grow until the OS will kill it once memory is exhausted (per your current experience). The ...
user avatar
10 votes

Where do you find the citext module in postgres 9.3 on ubuntu 14.04?

Turns out the answer was on Stack overflow. And Daniel commented on it right about the time I was installing it. sudo apt-get install postgresql-contrib-9.3 https://stackoverflow.com/a/22833812/...
user avatar
  • 305
10 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 ...
user avatar
  • 30.8k
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....
user avatar
  • 216
10 votes

How to uninstall pgAdmin4 on Ubuntu 16.04?

sudo apt autoremove pgadmin4 works for ubuntu version 18.04
user avatar

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