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'
- First we will be asked for our root password, enter it now.
- Validate Password plugin: No
- Change the root password: No
- Remover Anonymous users : Yes
- Disallow root login remotely: Yes
- Remove test databases: Yes
- 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!