2

Is there a way to find all postgresql and mysql databases on my system? (Perhaps using the find command).

2
  • Do you search versions like postgresql-8.3, postgresql-8.5, etc. or do you search where the data is stored?CommentedMar 29, 2012 at 18:15
  • @userunknown I do search where the data is stored
    – student
    CommentedMar 29, 2012 at 18:28

2 Answers 2

2

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.

2
  • +1 Considering that some relational databases may not even use an FS. :)
    – Karlson
    CommentedMar 29, 2012 at 14:58
  • Thanks, but actually I want to know how to search the FS for relational databases.
    – student
    CommentedMar 29, 2012 at 15:12
0

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.

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.