Is there a way to find all postgresql and mysql databases on my system? (Perhaps using the find command).
-
Do you search versions like postgresql-8.3, postgresql-8.5, etc. or do you search where the data is stored?user unknown– user unknown2012-03-29 18:15:35 +00:00Commented Mar 29, 2012 at 18:15
-
@userunknown I do search where the data is storedstudent– student2012-03-29 18:28:08 +00:00Commented Mar 29, 2012 at 18:28
Add a comment
|
2 Answers
If the database servers are running, ask them:
psql -l
mysql <<< 'show databases'
Just searching the filesystem for relational databases is not a trivial task.
-
+1 Considering that some relational databases may not even use an FS. :)Karlson– Karlson2012-03-29 14:58:31 +00:00Commented Mar 29, 2012 at 14:58
-
Thanks, but actually I want to know how to search the FS for relational databases.student– student2012-03-29 15:12:38 +00:00Commented Mar 29, 2012 at 15:12
On my system, the files for postgresql 8.4 are installed in:
sudo ls -l /etc/postgresql/8.4/main/pgdata/base/
sudo ls -l /var/lib/postgresql/8.4/main/base
where /etc contains a symbolic link to /var/lib.
You need sudo permissions to watch these directories.