People who code: we want your input. Take the Survey

Hot answers tagged

122

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


60

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


28

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


23

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


20

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


20

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


20

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-key add - sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sudo apt-get update ...


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 <<< '...


15

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


15

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 pg_lsclusters will list all the postgres clusters running on your device eg: Ver Cluster Port Status Owner Data directory Log file 9.6 main ...


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


14

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 already in the path. User-specific Method You can use the tutorial's recommended method. The tutorial states the following: Optional: Add /opt/mssql-tools/bin/...


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

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. sudo systemctl disable mysql Now you can start and stop MySQL with sudo systemctl stop mysql.service sudo systemctl start mysql.service


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


12

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


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

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


11

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


11

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


11

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


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

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

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 then get put into the Postgres log file, and it won't reload the config. Example log: 2016-10-05 10:31:57 BST LOG: received SIGHUP, reloading configuration ...


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"


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