WEB375 Lab 6: Configure a MySQL Server in Linux
The purpose of this lab is to configure MySQL server in Linux. Use the IP addresses that exist when you start Linux.
Virtual Machine Login Information for PLABFED01 and PLABFED02
During your session you will have access to the following lab configuration.
WINCONSOLE PLABFED01 PLABFED02
The Linux servers also connect to a private network. The IP address of PLABFED01 is 192.168.240.11 and the IP address of PLABFED01 is 192.168.240.12.
Connecting to Your Lab
In this module, you will be working on the following equipment to carry out the steps defined in each exercise.
• WINCONSOLE (Management Server)
• PLABFED01 (Linux Server)
• PLABFED02 (Linux Server)
Each exercise will detail which console you are required to work on in order to carry out the steps.
To start, simply click on the named server from the device list (located on the left hand side of the screen) and click the Power on from the Tools bar. In some cases the devices may power on automatically.
During the boot up process, an activity indicator will be displayed in the Name tab:
• Black – Powered Off
• Orange – Working on your request
• Green – Ready to access
If the remote console is not displayed automatically in the main window (or popup), click the Connect icon located in the Tools bar to start your session.
If the remote console does not appear, please try the following option:
• Switch between the HTML 5 and Java client versions in the Tools bar.
In the event this does not resolve your connectivity problems, please visit our Help / Support pages for additional resolution options.
TASK A – General Background Information
This Lab shows the basic steps of configuring a MySQL server and creates a simple database.
The steps to do this include:
• Install and start MySQL.
• Create a MySQL “root” user.
• Secure the MYSQL installation.
• Create your application’s database.
• Create your database’s data tables.
• Perform a basic query from the database.
TASK B – Configure Basic Settings for MySQL Step-By-Step
We start by setting up a basic MySQL server. As always when doing any type of system administration, we need to perform them using root account. Use Putty to logon plabfed01 as root.
Step 1. To stop all firewalls or security features, type the following commands:
#systemctl stop firewalld
#systemctl stop iptables
Step 2. Make sure the MySQL packages are installed. You should be able to discover this with the following command:
If it tells you that mariadb is not installed, to install it type:
#yum –y install mysql mysql-server
Step 2. To start the mysqld service, type:
#systemctl start mysqld
Step 3. To check the mysqld status, type:
#systemctl status mysqld
An active mysqld status looks like this:
Note: You can check for errors using command journalctl –xn. Below is a sample of journalctl –xn command output without any error.
Step 4. MySQL Secure Installation performs the following:
• Set (change) root password
• Remove anonymous users
• Disallow root login remotely
• Remove test database and access to it
• Reload privilege tables
To secure the MYSQL installation, type:
The prompt will ask you for your current root password, so leave it blank by pressing Enter.
The prompt will next ask you if you want to set a root password. Choose “Y” and follow the instructions. Use the root password Password.
Fedora automates the process of setting up MySQL, asking you a series of yes or no questions. Say “yes” to all the options, or press Enter since “yes” is the default selection. At the end, MySQL will reload and implement the new changes.
Step 5. Connect to MySQL database (localhost) with password:
# mysql -u root -p
Note: The -p will make it prompt you for a password.
The root password is Password.
Step 6. To exit MySQL database, type:
TASK C – Create Your First SQL Server Database in Three Quick Steps
Connect to MySQL database (localhost) with password using command mysql -u root -p
Step 1. Create database
To create a new database called Your_First_Name_DB (i.e. MelissaDB), type the following statement and press Enter :
Note: Mine is called MyFirstDB; yours should be named differently.
Note: The statement is ended with the ; (semi colon)
Step 2. To use the new database, type the following command and press Enter:
Step 3. Create new table
To create an Employees table to hold data, type the following command and press Enter:
Step 4. Enter data
To enter data into the Employees table, type the following statements:
Step 5. View data and exit MySQL
Execute the following statements:
TASK D – Lab Report Preparation
Step 1. Be sure in root account. Clear the screen and type the command #systemctl status mysqld to display the mysqld status and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the #systemctl status mysqld command.
Step 2. Be sure in root account. Clear the screen and use the command #mysql –u root -p file to logon to the mysql database as root and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the #mysql –u root -p command.
Step 3. Use the statement show databases; to display the list of current databases showing Your_First_Name_DB database, and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the show databases; statement.
Step 4. Use the statements USE and SELECT to view the table’s content of the Your_First_Name_DB database and capture the Linux desktop. Save this image to your Lab Report document in the space allocated for the SELECT statement.
This concludes the Week 6 Lab.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at firstname.lastname@example.org.
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at email@example.com and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at firstname.lastname@example.org.
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.