Deploy to Local VM

Install and Configure MySQL

Note: recent versions of Ubuntu (20.04) require you to login to MySQL using 'sudo mysql' instead of the familiar 'mysql -u root -p' when logging in as root.

Overview

  1. Update APT cache
    $ sudo apt update                
  2. Install MySQL
    $ sudo apt install mysql-server  
  3. Secure MySQL Installation
    $ sudo mysql_secure_installation 
  4. Login and Create Required Accounts
    $ sudo mysql                     

Step 1 - Update APT cache

$ sudo apt update

Step 2 - Install MySQL

$ sudo apt install mysql-server

Step 3 - Secure MySQL Installation

$ sudo mysql_secure_installation
New password: {Enter password}
Re-enter new password: {Re-enter password}
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

Step 4 - Login and Create Required Accounts

$ sudo mysql
mysql> CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
mysql> GRANT ALL PRIVELEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;