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

mysql_secure_installation

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
owners.

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

mysql> 

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 https://t.co/Uu3RzICAjp Installing a Hyper 212 EVO on AMD AM3+

Shaun Freeman @Zendmaster

Setting Up A Test Environment For PHP In VirtualBox - Part 6 Installing Multiple PHP Versionss: https://t.co/xNXeX4XDlQ via @YouTube

Shaun Freeman @Zendmaster

I added a video to a @YouTube playlist https://t.co/xNXeX4XDlQ Setting Up A Test Environment For PHP In VirtualBox - Part 6 Installing

Shaun Freeman @Zendmaster

Banished LP #1 - Humble Beginnings: https://t.co/5riUkijyLq via @YouTube

Shaun Freeman @Zendmaster

Installing Banished on Ubuntu 18.04: https://t.co/5judq1fMSc via @YouTube