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
Labs

Install and Configure MySQL Server (Ubuntu)

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 Ubuntu 18.04 and ensuring that it has been properly secured.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 0m
Published
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 APT Repository Configuration File from the MySQL APT Repository Download Page

    Download the MySQL APT repository configuration file from the MySQL APT repository download page. In the cloud_user's home directory, run the following:

    ```
    wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
    ```
    
  2. Challenge

    Install and Configure the Downloaded Release Package

    Install the downloaded release package for the MySQL server and re-synchronize the package index files. In the package configuration window, make sure that the MySQL server and cluster is set to mysql-8.0 and the MySQL tools and connectors is Enabled

    1. In the cloud_user’s home directory, use the dpkg package manager to install the release package:

      sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
      
    2. In the package configuration window, ensure that the MySQL Server and Cluster is set to mysql-8.0, the MySQL Tools and Connectors is Enabled, and the MySql Preview Packages is Disabled, then hit Ok:

      MySQL Server & Cluster (Currently selected: mysql-8.0)
      MySQL Tools & Connectors (Currently selected: Enabled)
      MySQL Preview Packages (Currently selected: Disabled)
      
      Ok
      
    3. Re-synchronize the package index:

      sudo apt update -y
      
  3. Challenge

    Install MySQL Server and Dependencies

    1. Use the apt command to install the MySQL server:

      sudo apt install -y mysql-server
      

      You are no longer required to enter the root password: Linux4me!, then select Use Strong Password Encryption (RECOMMENDED).

  4. Challenge

    Check the MySQL Server Status

    1. Validate that the mysql service is running:

      sudo systemctl status mysql
      
    2. Log in to the MySQL server as the root user (enter password when prompted):

      sudo mysql -u root -p
      
    3. To log out of the mysql prompt, type exit and hit enter.

  5. Challenge

    Secure the MySQL Server Installation

    Secure the MySQL server installation by ensuring that the validation password policy is set to strong, removing anonymous users, disabling remote root login, removing the test database, and reloading the privilege tables.

    1. Begin the installation by running the mysql_secure_installation command (enter the Linux4me! password when prompted):

      mysql_secure_installation
      
    2. Answer the following questions to complete the secure installation:

    Would you like to setup VALIDATE PASSWORD plugin? y
    Set the level of the password validation password to STRONG: 2 
    Please set the password for root here: Linux4me!
    Do you wish to continue with the password provided? y
    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