2320c17b57716faf911695c1107143a0e466af50
[plewww.git] / INSTALL.mysql.txt
1 // $Id: INSTALL.mysql.txt 144 2007-03-28 07:52:20Z thierry $
2
3 CONTENTS OF THIS FILE
4 ---------------------
5
6  * Introduction
7  * Installation and configuration:
8     - Database and user creation
9     - Drupal schema loading
10
11 INTRODUCTION
12 ------------
13
14 This file describes how to create a MySQL database for Drupal.
15
16 If you control your databases through a web-based control panel,
17 check its documentation, as the following instructions are for the
18 command line only.
19
20 INSTALLATION AND CONFIGURATION
21 ------------------------------
22
23 1. CREATE THE DRUPAL DATABASE
24
25    This step is only necessary if you don't already have a database
26    set-up (e.g. by your host). In the following examples, 'dba_user' is
27    an example MySQL user which has the CREATE and GRANT privileges. Use
28    the appropriate user name for your system.
29
30    First, you must create a new database for your Drupal site
31    (here, 'databasename' is the name of the new database):
32
33      mysqladmin -u dba_user -p create databasename
34
35    MySQL will prompt for the 'dba_user' database password and then create
36    the initial database files. Next you must login and set the access
37    database rights:
38
39      mysql -u dba_user -p
40
41    Again, you will be asked for the 'dba_user' database password.
42    At the MySQL prompt, enter following command:
43
44      GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
45      ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
46      ON databasename.*
47      TO 'username'@'localhost' IDENTIFIED BY 'password';
48
49    where
50
51     'databasename' is the name of your database
52     'username@localhost' is the username of your MySQL account
53     'password' is the password required for that username
54
55    Note: Unless your database user has all of the privileges listed
56    above, you will not be able to run Drupal.
57
58    If successful, MySQL will reply with:
59
60      Query OK, 0 rows affected
61
62    To activate the new permissions, enter the following command:
63
64      FLUSH PRIVILEGES;
65
66 2. LOAD THE DRUPAL DATABASE SCHEMA
67
68    Once you have a database, you must load the required tables into it.
69    Depending on the version of MySQL you are using, you must use the
70    file 'database.4.0.mysql' (for MySQL 4.0 or lower) or
71    'database.4.1.mysql' (for MySQL 4.1 or higher). Both files are
72    located in Drupal's database directory.
73
74    If you use a web-based control panel, you should be able to upload
75    the appropriate file and run it directly as SQL commands.
76
77    From the command line, use (again, replacing 'username' and
78    'databasename' with your MySQL username and database name):
79
80    for MySQL 4.0 or lower:
81      mysql -u username -p databasename < database/database.4.0.mysql
82
83    for MySQL 4.1 or higher:
84      mysql -u username -p databasename < database/database.4.1.mysql
85