PostgreSQL: Difference between revisions
From MoodleDocs
No edit summary |
Helen Foster (talk | contribs) (copying recent changes from 21 wiki) |
||
(7 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Installing Moodle}} | |||
PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation. | PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation. | ||
== Creating Moodle Database == | |||
These instructions assume that the database server and web server are on the same machine. If that is not the case you have some more work to do. See the PostgreSQL documentation for further details. | |||
PostgreSQL is | * Log into the PostgreSQL command line client. The exact form depends on how your PostgreSQL is configured but will be something like: | ||
<pre> | |||
$ psql -U postgres | |||
Password for user postgres: | |||
</pre> | |||
(enter the password for your 'postgres' user set during installation). After some preamble you should see the prompt ''postgres=#''. | |||
* Create the user for the Moodle database and assign a password: | |||
<pre> | |||
postgres=# create user moodleuser with password 'yourpassword'; | |||
</pre> | |||
...substituting a suitably strong password. | |||
* Create the database: | |||
<pre> | |||
postgres=# create database moodle owner moodleuser; | |||
</pre> | |||
== See also == | |||
* | * [http://www.postgresql.org PostgreSQL home page] | ||
* | * [[Arguments in favour of PostgreSQL]] | ||
* | * [http://moodle.org/mod/forum/view.php?id=45 Using Moodle - Databases forum] | ||
* | * [http://en.wikipedia.org/wiki/Postgres Wikipedia article on PostgerSQL] | ||
* | * Using Moodle [http://moodle.org/mod/forum/discuss.php?d=49195 Upgrading to 1.6 and may need to switch to PostgreSQL] forum discussion | ||
[[Category:SQL databases]] | |||
[[ja:PostgreSQL]] |
Latest revision as of 10:05, 8 December 2011
PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation.
Creating Moodle Database
These instructions assume that the database server and web server are on the same machine. If that is not the case you have some more work to do. See the PostgreSQL documentation for further details.
- Log into the PostgreSQL command line client. The exact form depends on how your PostgreSQL is configured but will be something like:
$ psql -U postgres Password for user postgres:
(enter the password for your 'postgres' user set during installation). After some preamble you should see the prompt postgres=#.
- Create the user for the Moodle database and assign a password:
postgres=# create user moodleuser with password 'yourpassword';
...substituting a suitably strong password.
- Create the database:
postgres=# create database moodle owner moodleuser;