Drupal Setup

This site was built using Drupal 4.7. It was relatively easy and quick to get the basic site up and runnning. Drupal requires a database underneath the GUI. I chose MySQL. The first thing you must do is create a MySQL database. Most hosting providers worth their salt offer MySQL.

MySQL can be intimidating at first, but one you spend some time with it, it's just another database. Just takes some getting used to.

Here is a simple recipe for creating a drupal-compatible database on your server:

  • Create a new database for your Drupal installation. We'll call it mydatabase:
  • $ mysql -p (when prompted, enter password for your root or admin user
  • mysql> create database mydatabase; (note the semicolon is required)
  • Next you must create a user and grant him privileges to access your db:
  • mysql> GRANT ALL PRIVILEGES ON mydatabase.* TO new_user@localhost IDENTIFIED BY 'password';
  • Take note of the following: the new user you are creating with this command is new_user. The password associated with the MySQL account new_user is password. You are granting full privileges, but only for the tables in your own database. Finally, the single-quotes surrounding the password seem to be necessary on the command line.
  • Once you have completed the database and user creation above, you must populate the database with the Drupal required tables, according the the schema provided by Drupal.
  • $ mysql -u new_user -p mydatabase Note the drupal_schema comes from the Drupal installation, and is called database/database.4.1.mysql for MySQL 4.1, or database/database.4.0.mysql for 4.0, etc.

Once these steps are complete, you should be able to view the tables in your new database. Go back into mysql and verify using the following command:

  • # mysql -u new_user -p
  • Enter password when prompted
  • mysql> use mydatabase;
  • mysql> show tables;
  • The above command should display many rows, in my installation there were 57 rows in the displayed set!
  • You are done with the MySQL setup at this point