1. Prerequisites
-
$ 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
-
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
-
Installing of YUM packages (yum install)
-
Installing MySQL
-
Setting up MySQL
-
Configure MySQL
-
Test MySQL
-
$ yum search
-
$ yum install
-
$ …
-
The trainer will now create a database wildlife
-
The trainer will now create a table bird in the database
-
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
$ 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!!! |
-
Just to be sure check the available space on the server (df / du commands are needed)
-
Learning your way in Linux using MySQL
-
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
-
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!!! |
-
Create a database
2.6.1. Takeaway
-
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)
-
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
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
-
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 |
|
YUM command cheat sheet |
|
TecMint Linux Tutorials |