Install MySQL Database Server

MySQL is the recommended database for Drupal, and Drupal 7 requires version 5.0.15 or higher. The following will walk you through installing MySQL server on Ubuntu Server and creating a database for your first Drupal site. More details are available in the MySQL section of the Ubuntu Server Guide.

Install MySQL.You will be prompted during installation to create a root password. MySQL will be installed to /var/lib/mysql.:

sudo apt-get install mysql-server mysql-client

Create a new database, user and password. You will be prompted for the root password that you created in the previous step. Be sure to replace "yourdbname", "username" and "password" with those of your choice for Drupal's database instance:

mysql -u root -p
mysql> CREATE DATABASE yourdbname; 
mysql> GRANT ALL PRIVILEGES ON yourdbname.* to 'username'@'localhost' IDENTIFIED BY 'password'; 
mysql> FLUSH PRIVILEGES; 
mysql> quit

Find an error? Know a better way? Please leave a comment and help improve this cookbook.