Setting Up A Testing Environment For PHP Using VirtualBox - Part 4 Installing MySQL

Setting Up A Testing Environment For PHP Using VirtualBox - Part 4 Installing MySQL

Now we have installed Nginx the next part before we compile and install PHP is to install and configure MySQL. So let's get to it.

This is a very trivial operation so should be quick. First we install MySQL from the repository with

sudo apt install mysql-server mysql-client

During the installation you will be asked to set a root MySQL password, just remember what you set!

Next a good practice is to run 'mysql_secure_installation' command so


We will then be asked a series of questions which we will answer 'yes' or 'no'

  1. First we will be asked for our root password, enter it now.
  2. Validate Password plugin: No
  3. Change the root password: No
  4. Remover Anonymous users : Yes
  5. Disallow root login remotely: Yes
  6. Remove test databases: Yes
  7. Reload Privileges: Yes

We we have done that we can test our connection by

mysql -uroot -p

Enter your password when propted and the you should see someting like

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.23-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


Here we can see the mysql propt and can now query ant databases. To quit this just type quit then press enter.

And that it for this one. Next one will compile and install PHP.

In the meantime happy code guys!

Watch on youtube: Setting Up A Test Environment For PHP In VirtualBox - Part 4 Installing MySQL

13/09/2018 11:24:00 Shaun Freeman Filed Under: MySQL Linux, MySQL, Server, Ubuntu, VirtualBox

Twitter Feed
Shaun Freeman @Zendmaster

Shaun Freeman @Zendmaster

I liked a @YouTube video From Carnivore Diet to Near-Death: Lessons Learned From Today's Most Popular Fad Diet

Shaun Freeman @Zendmaster

I liked a @YouTube video Carnivore Diet – Myths about Meat – Phil Escott – WHIS 2018

Shaun Freeman @Zendmaster


Shaun Freeman @Zendmaster

I liked a @YouTube video Dr. Paul Mason - 'Low Carb from a Doctor's perspective'

Shaun Freeman @Zendmaster

I added a video to a @YouTube playlist It's Already Too Late - Elon Musk