You are here

INSTALL.mysql.txt in Drupal 4

Same filename and directory in other branches
  1. 5 INSTALL.mysql.txt
  2. 6 INSTALL.mysql.txt
  3. 7 INSTALL.mysql.txt
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

File

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