How do you setup a MySQL database to use with a WordPress installation?

October 26, 2013 14.5k views
I have a "Wordpress on Ubuntu 12.10" droplet (512MB Ram 20GB SSD Disk) and I would like to setup additional WordPress installations. But I first need to know how to setup a MySQL database under such a scenario. What are the exact steps to setup a MySQL database to use with a WordPress installation using DigitalOcean? Thanks!
3 Answers
First make a password;
openssl rand -base64 16

Then create database and user and privileges. Then flush privileges.

mysql -u root mysql -p
CREATE DATABASE ideside;
CREATE USER 'ideuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON ideside.* TO 'ideuser'@'localhost';
FLUSH PRIVILEGES;

Obviously replace with your own data.
Thank you very much "dvikan"! I sincerely appreciate it.

When you say "First make a password", are you referring to the password that I would type in when I do this "ssh root@IP-ADDRESS-HERE"? If so, I already have a password for that. Should I just go straight to: mysql -u root mysql -p

And just to use my own data here, would this be right:

mysql -u root mysql -p
CREATE DATABASE wpdb01;
CREATE USER 'wpdb01'@'localhost' IDENTIFIED BY 'blahblah';
GRANT ALL PRIVILEGES ON wpdb01.* TO 'wpdb01'@'localhost';
FLUSH PRIVILEGES;

I have the username and database as the same name here and the password as "blahblah".

Thanks again!
by Justin Ellingwood
WordPress is a popular content management system (CMS) that can be used to quickly launch blogs and websites. In this guide, we will discuss how to launch two separate blogs, each associated with their own domains, from one VPS.
Have another answer? Share your knowledge.