1. Prerequisites

Definitions
  • $ in front of an instruction mean that you have to invoke this at the prompt

2. Topic: Install MySQL

2.1. Introduction

(1 pmd: subtotaal 2)

In the previous days we learned the basics regarding Linux and the commandline. Now you are working on Acme Corporations and we are getting to the point where the rubber hits the road and we are going to install MySQL on Linux

We are going to install version 8 (eight) of MySQL

2.2. Learning objectives

By the end of this module, learners will be able to
  • describe the interactions and responsibilities when we are installing a YUM package, e.g. the mysql

  • Identify the necessary configurations to support MySQL

  • Test the MySQL resources by issuing database commands and validating the response using the shell

2.3. Why and When: Install MySQL

We are going to install the MySQL Server since a new customer of our Acme firm needs some functionality which MySQL delivers

2.4. Instructor Demo: Install MySQL

In this demo, we’ll illustrate
  • Installing of YUM packages (yum install)

  • Installing MySQL

  • Setting up MySQL

  • Configure MySQL

  • Test MySQL

We will install MySQL from YUM using the follow commands
  • $ yum search

  • $ yum install

  • $ …​

Create a database and table(s)
  • The trainer will now create a database wildlife

  • The trainer will now create a table bird in the database

Bird properties
  • name: String

  • age: integer

  • …​

2.4.1. Demo summary

  • Install

    • yum search

    • yum install

  • Configure

  • Start / Restart

    • $ sudo systemctl start <application>

    • $ sudo systemctl restart mysql

  • Created a database

General form
$ systemctl status / reload / restart / stop / start <application>

2.5. Intermediate takeaway

Q & A before entering the exercise ???

2.6. Exercise: Install MySQL

(2 pmd: subtotaal 4)

We will NOT use the Redhat packages, but we will use the official MySQL packages!!!
Prerequisites
  • Just to be sure check the available space on the server (df / du commands are needed)

Target
  • Learning your way in Linux using MySQL

Roadmap
  • Do I have enough privileges to install the software

  • Do I need to add a YUM repo?

  • Which version of MySQL do I need to install?

  • Install MySQL

Steps
  • Execute an RPM command to enable MySQL yum repository on CentOS

  • Show the newly repository

    • $ ls -latr /etc/yum.repos.d/

    • Should show you the newly added MySQL repo!

  • Then you can find and install

    • $ yum search mysql

    • $ yum install mysql

See the link below since that sums is all up very nice and tidy!!!
Validation ⇒ Now we have to test the correct working of MySQL
  • Create a database

2.6.1. Takeaway

In this exercise, you have made a plan, reviewed the plan and set up MySQL
  • Why did we need YUM

  • Why is YUM used for packaging Linux applications

  • How to add a MySQL to your Linux machine

  • Did you find some new commands during the case?

    • What did you do to find the working of the unknown command(s)?

2.7. Bonus Exercise 1

(1 pmd: subtotaal 5)

Nice to haves
  • Create a script which installs, starts and tests (using mysql client) the MySQL installation

  • Optional: Add the epel repository on the server (look this up on the internet)

2.8. Bonus exercise 2

Case 2

In case :-), your are done with the previous case, you can start the second case (Apache) which will be introduced by the trainer.

2.9. Bonus exercise 3

Bonus Logging
  • Use the tail command to show the logging of mysql

3. Showtime

(1 pmd: subtotaal 6)

Show the team the result you have created!!!

4. Interesting reads

MySQL

MySQL database server

YUM command cheat sheet

YUM command cheat sheet

TecMint Linux Tutorials

TecMint Linux Tutorials