Create the database
Drupal requires access to a database in order to be installed. Your database user will need sufficient privileges to run Drupal. Additional information about privileges, and instructions to create a database using the command line are available in INSTALL.mysql.txt (for MySQL) or INSTALL.pgsql.txt (for PostgreSQL).
To create a database using PHPMyAdmin or a web-based control panel consult the documentation or ask your web host service provider.
Take note of the username, password, database name and hostname as you create the database. You will enter these items in the install script.
Create database with MySQL
This step is only necessary if you don't already have a database set-up (e.g. By your host). In the following examples, 'username' 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 username -p create databasename
MySQL will prompt for the 'username' database password and then create the initial database files. Next you must login and set the access database rights:
mysql -u username -p
Again, you will be asked for the 'username' database password. At the MySQL prompt, enter following command:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER 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;
the database should be created with UTF-8 (Unicode) encoding.
Create database with PostgreSQL
The database must be created with UTF-8 (Unicode) encoding.
1. CREATE DATABASE USER
This step is only necessary if you don't already have a user setup (e.g. by your host) or you want to create new user for use with Drupal only. The following command creates a new user named "username" and asks for a password for that user:
createuser --pwprompt --encrypted --no-adduser
--no-createdb username
If everything works correctly, you'll see a
"CREATE USER" notice.
2. CREATE THE DRUPAL DATABASE
This step is only necessary if you don't already have a database setup (e.g. By your host) or you want to create new database for use with Drupal only. The following command creates a new database named "databasename", which is owned by previously created "username":
createdb --encoding=UNICODE --owner=username databasename
If everything works correctly, you'll see a "CREATE DATABASE" notice.

The above info on MySQL
The above info on MySQL permissions is incorrect. They will provide either errors (lack of LOCK TABLES) or warnings (lack of CREATE TEMPORARY TABLES).
The corrected permissions are:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY 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
You will need the ` around the database name if you use an escape character in your schema name.
Ex: drupal_test_account.* should be drupal\_test\_account.* for security (underscore is a wildcard). This requires the ` wrapper. `drupal\_test\_account`.*
New Users Read This
Not only is the INSTALL.mysql.txt wrong, its misleading.
It talks about skipping if you don't already have a database setup, but what if mysql isn't set up? Oops.
If you have not set up users and passwords in your database system yet go here:
http://dev.mysql.com/tech-resources/articles/mysql_intro.html
and follow the directions. Don't shortcut and just type in the commands, read the text. The time you save
will be your own!
/Len
WT6G
drupal works with informix?
Hi everybody!... Does anyone knows about a project drupal with informix?... Is it supported?
Guide installing Drupal with DB Oracle 9i ???
Hi, can I get a guide step by step for a Drupal installation with DB Oracle 9i? thanks
Database character set
For MySQL it seems that Drupal sets utf8 as the default character set for each individual database table, so I guess that's why there's no need to worry about setting a charset for a MySQL database. (The only other place a MySQL database's charset matters is for LOAD DATA INFILE: http://dev.mysql.com/doc/refman/5.1/en/charset-database.html )
My database experience with drupal 6.12 on windows ...
I used xampp 1.7.1 for apache, mysql, php etc. By default xampp sets up a mysql account with root as the username, and with a blank password. This comes with the phpmyadmin tool, and its accessible as a link from from http://localhost/xampp. I created a database from phpmyadmin with no tables. You need to specify the "collation", for which I chose utf_general_ci .
The Apache document root is xampp\htdocs . Create a directory "mysite" in htdocs and put the drupal files there. Then, when you point your browser to http://localhost/mysite , the drupal installation process should begin.
During drupal installation, you need to specify the name of the database and username and password for the database. I got an error when I used "root@localhost" as the username. However, the installation went through OK after I used just "root".