Wednesday, January 18, 2017

Oracle MySQL Server 5.6 installation

This post covers the high-level installation steps of Oracle MySQL Database server installation. download the required binaries from the below downloads link. In this post we are covering the installation of MySQL Community server 5.6 edition.

Downloads: https://www.mysql.com/downloads

Environment: RHEL/OEL 6
Documentation: https://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html

Steps:

  • Download the binaries from above specified location and save it in a temporary folder to extract

  • Extract the software using tar
    • tar -xvf MySQL-5.6.32-1.linux_glibc2.5.x86_64.rpm-bundle.tar
  • Below files are extracted as from the above command
 
  • Before starting the installation from the above files, run the below command to check if you have any existing MySQL instances running on this machine
    • rpm -qa | grep mysql
  •  Delete the existing instances as given below 
    • rpm -e mysql-libs-5.1.73-3.el6_5.x86_64 --nodeps           
  • Now it is clean to start installation procedure.
  • Install the binaries using the below rpm command as shown below. you might have to run this installation as root depending on your privileges
  • Each rpm package extracted will have its own purpose. please refer to provided mysql documentation link for more information on these packages. 
  • we are going to install the basic required packages that are mentioned below
    • rpm -ivh MySQL-server-5.6.35-1.linux_glibc2.5.x86_64.rpm
    • rpm -ivh MySQL-client-5.6.35-1.linux_glibc2.5.x86_64.rpm
    • rpm -ivh MySQL-devel-5.6.35-1.linux_glibc2.5.x86_64.rpm 
    • rpm -ivh MySQL-shared-compat-5.6.35-1.linux_glibc2.5.x86_64.rpm
 
 
  • Installation sets random password that is stored in the file that is highlighted above.
  • Install the remaining rpm packages with the similar command as shown below
 
  • Now the installation procedure is completed and you can start the MySQL server

  • Access the password from the above mentioned file 
 
  • Run the following command to change the default password of root user(default user for mysql db) 
    • /usr/bin/mysql_secure_installation
  • Provide the password retrieve in the step above and provide it during the request for current root password
  • It will automatically takes you through reset password process. Now you can set your desired password
 
  •  Script will also take you through some more steps where you can select your options. It is always recommended to change any default settings such as anonymous access, remote logins and default password during the enterprise installation
  • Login to the MySQL server now with the new password.

Thank you for visiting.