Setup MySQL Database for WordPress
Vikram Sharma

Vikram Sharma @vikramchandra

About: Rails dev here.

Location:
India
Joined:
Sep 21, 2019

Setup MySQL Database for WordPress

Publish Date: Apr 14 '21
0 0

Here are the steps for setting up a database for WordPress on a Ubuntu server(Assuming MySQL in already installed).

  1. Log into mysql using root
    ''' sudo mysql -u root'''
    Note: On new Ubuntu version password is not required.

  2. Create a database.

CREATE DATABASE IF NOT EXISTS wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Or use UTF8mb4 if you want emojis.

CREATE DATABASE IF NOT EXISTS wordpress DEFAULT CHARACTER SET UTF8mb4 collate utf8mb4_bin;

  1. Create a User

CREATE USER IF NOT EXISTS 'wordpressuser'@'localhost' IDENTIFIED BY 'password';

CREATE USER IF NOT EXISTS 'wordpressuser'@'%' IDENTIFIED BY 'password';

  1. Grant privileges to the user

GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';

GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'%';

5.

FLUSH PRIVILEGES;

6.

\q

Nuff said.

Comments 0 total

    Add comment