Chris@0
|
1
|
Chris@0
|
2 CREATE THE PostgreSQL DATABASE
|
Chris@0
|
3 ------------------------------
|
Chris@0
|
4
|
Chris@0
|
5 Note that the database must be created with UTF-8 (Unicode) encoding.
|
Chris@0
|
6
|
Chris@0
|
7 1. CREATE DATABASE USER
|
Chris@0
|
8
|
Chris@0
|
9 This step is only necessary if you don't already have a user set up (e.g., by
|
Chris@0
|
10 your host), or want to create a new user for use with Drupal only. The
|
Chris@0
|
11 following command creates a new user named 'username' and asks for a password
|
Chris@0
|
12 for that user:
|
Chris@0
|
13
|
Chris@0
|
14 createuser --pwprompt --encrypted --no-createrole --no-createdb username
|
Chris@0
|
15
|
Chris@0
|
16 If there are no errors, then the command was successful.
|
Chris@0
|
17
|
Chris@0
|
18 2. CREATE DRUPAL DATABASE
|
Chris@0
|
19
|
Chris@0
|
20 This step is only necessary if you don't already have a database set up
|
Chris@0
|
21 (e.g., by your host) or want to create a new database for use with Drupal
|
Chris@0
|
22 only. The following command creates a new database named 'databasename',
|
Chris@0
|
23 which is owned by the previously created 'username':
|
Chris@0
|
24
|
Chris@0
|
25 createdb --encoding=UTF8 --owner=username databasename
|
Chris@0
|
26
|
Chris@0
|
27 If there are no errors, then the command was successful.
|
Chris@0
|
28
|
Chris@0
|
29 3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)
|
Chris@0
|
30
|
Chris@0
|
31 Drupal will run across different schemas within your database if you so wish.
|
Chris@0
|
32 By default, Drupal runs inside the 'public' schema but you can use $db_prefix
|
Chris@0
|
33 inside settings.php to define a schema for Drupal to run inside of, or
|
Chris@0
|
34 specify tables that are shared inside of a separate schema. Drupal will not
|
Chris@0
|
35 create schemas for you. In fact, the user that Drupal runs as should not be
|
Chris@0
|
36 allowed to do this. You'll need to execute the SQL below as a superuser,
|
Chris@0
|
37 replace 'username' with the username that Drupal uses to connect to
|
Chris@0
|
38 PostgreSQL, and replace 'schema_name' with a schema name you wish to use,
|
Chris@0
|
39 such as 'shared':
|
Chris@0
|
40
|
Chris@0
|
41 CREATE SCHEMA schema_name AUTHORIZATION username;
|
Chris@0
|
42
|
Chris@0
|
43 Do this for as many schemas as you need. See default.settings.php for
|
Chris@0
|
44 instructions on how to set which tables use which schemas.
|