Hot answers tagged

106

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, privilege_type from information_schema.role_table_grants where table_name='aliases'; grantee | privilege_type --------------+----------------- mailreader | ...


57

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 here: mysqladmin -u root -p variables


49

Ubuntu or Debian can run multiple instances of PostgreSQL and provide a specific way to autostart/stop/start each cluster. There should be a file named start.conf inside /etc/postgresql/9.2/main (or more generally /etc/postgresql/<version>/<clustername>) with these self-explanatory contents: # Automatic startup configuration # auto: automatically ...


25

The line in your netstat report shows that the database is only listening on localhost:5432 (127.0.0.1) for incoming tcp connections. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 3561/postgres So it can only accept local tcp connections regardless of what ...


24

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 [ pattern ] Lists tables, views and sequences with their associated access privileges. \l[+] [ pattern ] List the databases in the server and show .... ...


22

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 Assuming you wish to totally remove SQL Server, you should # Stop the service systemctl stop mssql-server.service sudo add-apt-repository --remove "$(curl ...


16

In the link that Dimitar provided, the question itself hints at a solution - if you're putting this in a script, you could add the SET PASSWORD line with an empty password. export DEBIAN_FRONTEND=noninteractive sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password PASS' sudo debconf-set-selections <<< '...


16

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 /etc/hosts was not set. Action: Set the host name and try again. Now, the command worked on my machine (Ubuntu laptop), but it didn't work on EC2. I ...


15

You are on Ubuntu and obviously have Martin Pitt's pg_wrapper installed (judging from pg_ctlcluster) that is provided by the package postgresql-common and comes with the standard Debian packages. I use the same on Debian. On a Linux system, run which in the shell to see which executable is actually picked: postgres@db:~$ which pg_dump /usr/bin/pg_dump ...


14

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: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834129 For now, consider the Postgres Apt repository: https://wiki.postgresql.org/wiki/Apt/FAQ


13

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, ARRAY(SELECT b.rolname FROM pg_catalog.pg_auth_members m JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid) WHERE m.member = r.oid) as ...


13

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 program requires a machine with at least 3250 megabytes of memory. Memory was added and SQL Server was started: systemctl status mssql-server


13

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 released in October and the Developer Edition is free for development purposes, as in previous versions.


13

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 party monitoring utilities. When SQL Server 2017 was released on Linux, unfortunately this DMV did not return correct CPU usage information by SQL Server ...


11

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


11

If you change lower_case_table_names in a DB with existing tables MySQL > Table doesn't exist. But it does (or it should) can happen. The comment to this answer helped me in this case: I reverted the value, restarted the database, exported the tables, set the value back to 1, restarted the database, re-imported the tables and everything worked again.


11

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|restart|reload|force-reload|status} [version ..] That command calls an init.d script which wraps around pg_ctlcluster. You can see that by opening /etc/init.d/...


11

There are two methods of resolving this. Insane Method for those that do not how to use Linux, advocated in the manual, add the directory to the environmental variable PATH. Sane Method that follows the Linux FHS, symlink the executable to the directory already in the path. Insane Method HINT: Do NOT follow the advice of the tutorial You can find the ...


10

I see two things wrong here. Oracle tries to open a parameter file in the $ORACLE_HOME/dbs directory with the format "spfile" + $ORACLE_SID + ".ora". If it cannot find it, it then tries to open "init" + $ORACLE_SID + ".ora". This is where the problem(s) are. By virtue of the fact that Oracle is trying to open a parameter file named "initXE.ora", your SID ...


10

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 reading. Try using the main PostgreSQL documentation, or up to date tutorials, in future. See: Connection and authentication settings Client authentication


10

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 usage of maxmemory should be coupled with maxmemory-policy - you can choose from different eviction policies depending on your use case's requirements. For ...


10

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 attempt to have more standard package names across Linux distributions, so the service was renamed to mongod (to reflect the actual daemon being started) and the ...


10

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/147562


10

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.py"


10

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/run/postgresql/. Try psql -h /tmp If that works, the above is the problem. You can add export PGHOST=/tmp to your .bashrc to change the default locally for ...


10

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 ~/nginx.key.rsa


10

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 several live PostgreSQL instances on debian-based systems. As installed by the postgresql-client package, psql is a link to pg_wrapper on such systems: /usr/bin/psql ...


9

When reading the configuration file, the mysql command line client only reads configuration directives found in the [client] and [mysql] sections, while mysqldump only uses configuration directives found in the [client] and [mysqldump] sections. If your socket directive in the config file is in the [mysql] section but not the [mysqldump] section then you ...


9

Neither MyISAM nor InnoDB have multithreaded query implementation. Nor do other XtraDB, TokuDB. It is a long standing issue and limitation of MySQL. I don't know that the limitation is within the MySQL server, but rather in the storage engine implementation. No one ever did it... I'm currently evaluating the column-store InfiniDB and Infobright IEE. They ...


9

"no space left on the device" could also mean that the partition is out of inodes. Use df -i to check inode usage. Edit: Each file, directory, and symbolic link requires one inode. So the idea is to remove some files from the / partition. It doesn't matter how large the files are. You can of course just pick some files on the partition and move them to ...


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