Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

Install and Configure MySQL Server (CentOS)

MySQL server is one of the most popular and widely-used relational databases. In this Lab, you will be tasked with installing a MySQL server on CentOS 7, and ensuring that it has been properly secured.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 1h 0m
Clock icon May 10, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Download the MySQL RPM Bundle tar File from the MySQL Community Server Downloads Page

    In the cloud_user home directory run the following:

    # wget

  2. Challenge

    Extract the RPM Files from the MySQL Bundle tar File

    In cloud_user’s home directory, Use the tar command to extract the RPM files from the bundle tar file:

    [cloud_user@host]$ tar -xvf mysql-8.0.15-1.el7.x86_64.rpm-bundle.tar
  3. Challenge

    Install the MySQL Server and Dependencies Using the `rpm` Command

    In cloud_user’s home directory, use the rpm command to install the MySQL server and dependencies:

    [cloud_user@host]$ sudo rpm -Uvh mysql-community-{server,client,common,libs}-*
  4. Challenge

    Start up the MySQL Server

    Use systemctl to start up the mysqld service:

    [cloud_user@host]$ sudo systemctl start mysqld
  5. Challenge

    Update the Password for the Superuser Account on the MySQL Server

    Locate the temporary password for the superuser:

    [cloud_user@host]$ sudo grep 'temporary password' /var/log/mysqld.log

    Using the temporary password, log into the MySQL server as the root user:

    [cloud_user@host]$ # mysql -u root -p

    Update the password for the root user:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '<NEW_PASSWORD>';

    For grading purposes, make sure NEW_PASSWORD is Linux4me!.

    Exit the mysql prompt:

    mysql> exit
  6. Challenge

    Secure the MySQL Server Installation by Ensuring That Anonymous Users Are Removed, Remote `root` Login Is disabled, the `test` Database Has Been Removed, and the Privilege Tables Have Been Reloaded

    Begin the installation by running the mysql_secure_installation command:

    cloud_user@host]$ mysql_secure_installation

    Answer the following questions to complete the secure installation:

    Change the password for root ? n
    Remove anonymous users? y
    Disallow root login remotely? y
    Remove test database and access to it? y
    Reload privilege tables now? y

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans