You are on page 1of 10

Install MySQL on Oracle Linux

This post is the last part of the Series Install MySQL on an Oracle Linux Virtual
Machine (Install MySQL on an Oracle Linux Virtual Machine).
The purpose of this post is to demonstrate how to install MySQL on an Oracle Linux
Virtual Machine, created on our previous post Install Oracle Linux on Virtual Machine.

Download
To start, we will download the MySQL binaries from Oracles e-delivery
website:edelivery.oracle.com.
1.

Visit the link: edelivery.oracle.com, and click on Sign in.

2.

Enter your Username and Password and click Sign in, or, if you dont have an Oracle
account, click Create Account.

3.

On Search by, type MySQL (Classic, Standard, or Enterprise), select the platform
Linux x86-64, and click Continue.

Note: Ill be using the MySQL Enterprise Edition.


4.

Click on Expand, select MySQL Database Server, and click Continue.

5.

Read the Oracle Standard Terms and Restrictions, accept the terms, and click
Continue.

6.

Select the file you want to download, on the example: V266964-01.zip MySQL
Database 5.7.13 RPM for Oracle Linux / RHEL 7 x86 (64bit), and click Download.

7.

Select the folder where you want to save the file V266964-01.zip and click on Save.

Installation
After you download the MySQL binaries, it is time to install it.
1. First, Ill create a directory /opt/packages to save the file that we just downloaded.
#mkdir/opt/packages

2. Copy the file V266964-01.zip to /opt/packages folder. (You can use WinSCP to copy
the file.)

3. After copy the file, check if the file exists on folder.


#ll/opt/packages

4. Move to folder /opt/packages.


#cd/opt/packages

5. Unzip the file V266964-01.zip to extract the .rpm files.


#unzipV26696401.zip

6. Install MySQL with the following command:


#sudoyumlocalinstallmysql-commercial*

7. Start the MySQL server with the following command:


#sudoservicemysqldstart

8. Check the status of the MySQL with the following command:


#sudoservicemysqldstatus

9. A user account root@localhost was created. A password for root was set and
stored in the error log file. To reveal it, use the following command:
#sudogrep'temporarypassword'/var/log/mysqld.log

10. Log in with the temporary password:


#mysqlurootp

Enter temporary password.


11.Once logged, change the root password with the following command:
mysql>ALTERUSER'root'@'localhost'IDENTIFIEDBY'NewPassword';

12. Check if password was changed by log in with the new password:
#MySQLurootp

Enter new password.

You finally have your MySQL installed on your Oracle


Linux Virtual Machine. Enjoy it!

You might also like