I'm trying to connect IHP's Postgres instance with Moodle. The IHP Guide uses postgresql:///app?host=YOUR_PROJECT_DIRECTORY/build/db
with the development server running to connect however Moodle further requires Database host, name, user, password, port, Tables prefix and Unix Socket to connect.
Asked
Active
Viewed 106 times
1

Varun Rajput
- 235
- 1
- 7
1 Answers
1
IHP uses a Postgres socket file to connect, the socket file is located at YOUR_PROJECT_DIRECTORY/build/db/.s.PGSQL.5432
.
The database name is app
, there is no password.
For example, with psql
you can connect to the database as: psql -h $PWD/build/db -d app
.
I'm not sure why are you trying to connect IHP with Moodle?
IHP dev server starts and restarts the Postgres database as you are developing, ./start
would start the database, and as soon as you exit, the database is stopped. However, it seems Moodle requires a database running forever in order to function.

danielsokil
- 52
- 7
-
1Yes, Moodle requires Postgres to run. Can you please also tell what's the database user? – Varun Rajput Apr 28 '22 at 03:59
-
1The user is either "postgres" or your current mac username (output of `echo $USER` in bash) – Marc Scholten Apr 28 '22 at 16:52