0% found this document useful (0 votes)
13 views

Lab E - Install Mysql Server On Linux Distribution

1. The document describes installing MySQL Server on a Linux distribution. It involves downloading the MySQL repository, installing the MySQL server package, configuring secure installation to change the root password and disable remote root login, and testing the installation by connecting to the database and viewing users and tables. 2. The installation is tested and tuned using a MySQLTuner script which analyzes performance metrics, hardware resources, and security recommendations for the MySQL instance. 3. Recommendations from the tuning script address potential issues found regarding system resources, accounts, and security settings of the new MySQL server installation.

Uploaded by

marlonb0007
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lab E - Install Mysql Server On Linux Distribution

1. The document describes installing MySQL Server on a Linux distribution. It involves downloading the MySQL repository, installing the MySQL server package, configuring secure installation to change the root password and disable remote root login, and testing the installation by connecting to the database and viewing users and tables. 2. The installation is tested and tuned using a MySQLTuner script which analyzes performance metrics, hardware resources, and security recommendations for the MySQL instance. 3. Recommendations from the tuning script address potential issues found regarding system resources, accounts, and security settings of the new MySQL server installation.

Uploaded by

marlonb0007
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

COURSE: MySQL Server Administration

LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Lab E – Install MySQL Server on Linux


Distribution.
Objective: New Installation of MySQL Server on Linux Distribution.

In this lab, you perform the following tasks:

1. Install MySQL Server follow the guide.


2. Configure Secure Installation in your MySQL Server instance.
3. Test and Tune your MySQL Server Instance.
4. Discussion.

NOTE: Before you will start this Lab, make sure that all VMs stay in OFF State. Just start
the VM for Linux CentOS.
Task 1: Install MySQL Server follow the guide.
-For this Lab you will use a VM with Linux CentOS 6.2 Distribution, when the OS stay at user stage, type
user root and password: Pa$$w0rd like credentials.

Page 1 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Page 2 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Click on Close.

Then, in the OS Desktop Right click and Select Open in Terminal:

This will open a new Console CLI Session for Linux OS.

Page 3 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

First, to set up the yum repository, install the mysql-community-server 5.7 RPM based on your
CentOS/RHEL release, type the following command and press Enter:
wget https://repo.mysql.com/mysql-community-release-el5-7.noarch.rpm --no-check-certificate

You will receive the message of Saving package…

Page 4 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Then Once the rpm file is saved, we will verify the integrity of the download by running md5sum and
comparing it with the corresponding MD5 value listed on the site, type the command and press Enter:

md5sum mysql-community-release-el5-7.noarch.rpm

Now that we've verified that the file wasn't corrupted or changed, we'll install the package, type the
following command and press Enter:
sudo rpm -ivh mysql-community-release-el5-7.noarch.rpm

Page 5 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

This adds two new MySQL yum repositories, and we can now use them to install MySQL server, Press y to
confirm that you want to proceed. Since we've just added the package, we'll also be prompted to accept
its GPG key. Press y to download it and complete the install. Type the following command and press Enter:

sudo yum install mysql-server

Type Y and Press Enter. For download packages process.

Page 6 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

You will note that server start a connection to Linux CentOS.org repository to download packages and
resolve dependencies of Kernel.

Type Y and Press Enter. To confirm the warning for Signature.

Page 7 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Type Y and Press Enter. To confirm the warning for Signature.

You will notice that some conflicts error about libraries. Type following command and press Enter:

clear

Page 8 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Review the status about your mysqld daemon, type the following command and press Enter:

service mysqld status

Now you will to start the mysqld daemon for your service, type the following command and press Enter:

service mysqld start

Page 9 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Review the status about your mysqld daemon, type the following command and press Enter:
service mysqld status

You will notice that your mysqld daemon for your service is UP and Running.

Don’t close your CLI Console.

Page 10 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Task 2: Configure Secure Installation in your MySQL Server Instance.


Open a new session in to your MySQL Server Instance, you need to configuring MySQL Type the following
command and press Enter:

sudo mysql_secure_installation

You change the current password for root, just press Enter to continue.

Page 11 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Type Y and Press Enter.

Now Type the new password to MySQL2019 and Press Enter. Next Re-enter the same password and press
Enter.

Page 12 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

You will notice that the process was successfully, then you need to aprobe or remove the anonymous user
access to MySQL Instance (ONLY For the Lab purpose you need aprobe). Type n and press Enter.

Now, you need to disallow root login remotely. (ONLY For the Lab purpose you need to allow). Type n and
press Enter.

Page 13 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

The MySQL by default comes with a database for test purpose with name “test”, and anyone User can
access to that. This can be a security hole in a production environment, but for the Lab purpose we don’t
remove it. Type n and Press Enter.

You need to Reload the privilege tables to ensure that changes made take effect immediately, type Y and
Press Enter.

Page 14 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

You will notice that the process for your MySQL Instace now its secure.

Don’t close your CLI Console.

Task 1: Test your MySQL Server Instance.


-Now connect to your MySQL Server Instance, type the following command and press Enter:

mysql -u root -h localhost.localdomain -p

Page 15 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

-Then type your password for the root user configured in task 2. (this will be MySQL2019) and Press Enter.

You notice that the prompt change and you enter to MySQL Console.

Type the following command and press Enter.

select User from mysql.user;

Page 16 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

-Connect to your test database and show If the Database have any table, Type following:
Use test;
SHOW TABLES;

Now you will Tune MySQL Server Instance. Type the following commands and press Enter:
exit
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl --no-check-
certificate

Page 17 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

You will notice that Saving the Script of mysqltuner.pl.

Now you need to run it, type the following command and press Enter:

perl ./mysqltuner.pl

Page 18 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Now the script start to execute, you need to provide the user for MySQL admin (Type root) and Press
Enter.

Now the script start to execute, you need to provide the password for MySQL admin (Type MySQL2019)
and Press Enter.

You will notice that at the end of the Script this show you a Recommendations List.

Page 19 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Now move the bar to UP and locate the Performance Metrics List.

You notice that the script review all the Resources of Hardware and Software Settings related to your
MySQL Instance and put on OK that is normal and !! some ones that you need attention.

Now move the bar to UP and locate the Security Recommendations List.

You notice that the script review all the Accounts of Users related to your MySQL Instance and put on OK
that is normal and !! someones that you need attention.

Page 20 of 21
COURSE: MySQL Server Administration
LAB E – INSTALL MYSQL SERVER ON LINUX DISTRIBUTION

Task 4: Discussion.
1. What recommendations you receive with run the mysqltuner.pl script.

2. What command you use when download the rpm of MySQL installer.

3. What is the complete instruction that you will use for install MySQL server.

4. What command you will use to review the status about your MySQL daemon.

5. What command you will use to start the MySQL daemon.

6. What is the complete instruction that you will use to install the rpm for MySQL server.

7. What command you will use to check the integrity of MySQL server package of rpm.

8. What is the complete instruction that you will use for secure installation about your MySQL server.

9. What is the complete instruction that you will use to enter into MySQL server Instance.

Page 21 of 21

You might also like