# WordPress Optimization: Installing and Configuring WordPress

> Part 5 of the WordPress optimization series - installing MySQL and WordPress on a Digital Ocean droplet.

- Canonical URL: https://webofmike.com/installing-and-configuring-wordpress/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2019-01-04
- Last modified: 2019-01-04
- Tags: Tutorials, Code
- Cite as: Mike Moore, "WordPress Optimization: Installing and Configuring WordPress", Web of Mike (webofmike.com), 2019-01-04. https://webofmike.com/installing-and-configuring-wordpress/


Welcome to part 5 of 8 in a series on Kick-Ass WordPress Optimization. This guide covers database and WordPress installation on a Digital Ocean droplet following server and DNS setup.

## Installing MySQL and Configuring Your Database

### Actually Installing MySQL

The foundation for WordPress requires a database to store posts, settings, and content. Installation begins with a console command:

```bash
sudo apt-get -y install mysql-server
```

During installation, you'll be prompted to set a root password---this is critical to record for future access.

### Creating a MySQL Database

After logging into MySQL with your root credentials, create a database with a command like:

```sql
CREATE DATABASE yourblog;
```

### Creating a MySQL User

Rather than using the root account (a security risk), establish a dedicated user:

```sql
CREATE USER 'yourblog'@'localhost' IDENTIFIED BY 'yourpassword';
```

### Granting User Permissions

Grant your new user database access:

```sql
GRANT ALL PRIVILEGES ON yourblog.* TO 'yourblog'@'localhost' WITH GRANT OPTION;
```

### Tuning MySQL for WordPress

Optimize performance by editing `/etc/mysql/my.cnf` and adding InnoDB configuration parameters for buffer pooling, flush methods, and file-per-table settings. Restart MySQL to apply changes.

## Installing and Configuring WordPress

Use the `wget` utility to download WordPress files directly to your server, then follow the standard installation wizard.

