summaryrefslogtreecommitdiffstats
path: root/INSTALL.mysql.txt
blob: 98f76a062347d3e72b6060059ff440c69a64a33c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// $Id$

CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Installation and configuration:
    - Database and user creation
    - Drupal schema loading

INTRODUCTION
------------

This file describes how to create a MySQL database for Drupal.

If you control your databases through a web-based control panel,
check its documentation, as the following instructions are for the
command line only.

INSTALLATION AND CONFIGURATION
------------------------------

1. CREATE THE DRUPAL DATABASE

   This step is only necessary if you don't already have a database
   set-up (e.g. by your host). In the following examples, 'dba_user' is
   an example MySQL user which has the CREATE and GRANT privileges. Use
   the appropriate user name for your system.

   First, you must create a new database for your Drupal site
   (here, 'databasename' is the name of the new database):

     mysqladmin -u dba_user -p create databasename

   MySQL will prompt for the 'dba_user' database password and then create
   the initial database files. Next you must login and set the access
   database rights:

     mysql -u dba_user -p

   Again, you will be asked for the 'dba_user' database password.
   At the MySQL prompt, enter following command:

     GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
     ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
     ON databasename.*
     TO 'username'@'localhost' IDENTIFIED BY 'password';

   where

    'databasename' is the name of your database
    'username@localhost' is the username of your MySQL account
    'password' is the password required for that username

   Note: Unless your database user has all of the privileges listed
   above, you will not be able to run Drupal.

   If successful, MySQL will reply with:

     Query OK, 0 rows affected

   To activate the new permissions, enter the following command:

     FLUSH PRIVILEGES;

2. LOAD THE DRUPAL DATABASE SCHEMA

   Once you have a database, you must load the required tables into it.
   Depending on the version of MySQL you are using, you must use the
   file 'database.4.0.mysql' (for MySQL 4.0 or lower) or
   'database.4.1.mysql' (for MySQL 4.1 or higher). Both files are
   located in Drupal's database directory.

   If you use a web-based control panel, you should be able to upload
   the appropriate file and run it directly as SQL commands.

   From the command line, use (again, replacing 'username' and
   'databasename' with your MySQL username and database name):

   for MySQL 4.0 or lower:
     mysql -u username -p databasename < database/database.4.0.mysql

   for MySQL 4.1 or higher:
     mysql -u username -p databasename < database/database.4.1.mysql