1 // $Id: INSTALL.mysql.txt 144 2007-03-28 07:52:20Z thierry $
7 * Installation and configuration:
8 - Database and user creation
9 - Drupal schema loading
14 This file describes how to create a MySQL database for Drupal.
16 If you control your databases through a web-based control panel,
17 check its documentation, as the following instructions are for the
20 INSTALLATION AND CONFIGURATION
21 ------------------------------
23 1. CREATE THE DRUPAL DATABASE
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.
30 First, you must create a new database for your Drupal site
31 (here, 'databasename' is the name of the new database):
33 mysqladmin -u dba_user -p create databasename
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
41 Again, you will be asked for the 'dba_user' database password.
42 At the MySQL prompt, enter following command:
44 GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
45 ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
47 TO 'username'@'localhost' IDENTIFIED BY 'password';
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
55 Note: Unless your database user has all of the privileges listed
56 above, you will not be able to run Drupal.
58 If successful, MySQL will reply with:
60 Query OK, 0 rows affected
62 To activate the new permissions, enter the following command:
66 2. LOAD THE DRUPAL DATABASE SCHEMA
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.
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.
77 From the command line, use (again, replacing 'username' and
78 'databasename' with your MySQL username and database name):
80 for MySQL 4.0 or lower:
81 mysql -u username -p databasename < database/database.4.0.mysql
83 for MySQL 4.1 or higher:
84 mysql -u username -p databasename < database/database.4.1.mysql