Step 1: Download RPMs from MySQL
Download required rpm files from MySQL cdn network using following following commands.
For 32 Bit Systems:
# cd /opt/ # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-server-5.7.2_m12-1.el6.i686.rpm # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-client-5.7.2_m12-1.el6.i686.rpm # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-shared-5.7.2_m12-1.el6.i686.rpm
For 64 Bit Systems:
# cd /opt/ # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-server-5.7.2_m12-1.el6.x86_64.rpm # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-client-5.7.2_m12-1.el6.x86_64.rpm # wget http://cdn.mysql.com/Downloads/MySQL-5.7/MySQL-shared-5.7.2_m12-1.el6.x86_64.rpm
Step 2: Install MySQL RPMs
Install downloaded rpms using rpm command line tool.
For 32 Bit Systems:
-ivhMySQL-server-5.7.2_m12-1.el6.i686.rpm # rpm -ivhMySQL-client-5.7.2_m12-1.el6.i686.rpm # rpm -ivhMySQL-shared-5.7.2_m12-1.el6.i686.rpm
For 64 Bit Systems:
-ivhMySQL-server-5.7.2_m12-1.el6.x86_64.rpm # rpm -ivhMySQL-client-5.7.2_m12-1.el6.x86_64.rpm # rpm -ivhMySQL-shared-5.7.2_m12-1.el6.x86_64.rpm
Step 3: Start MySQL Service
After installing rpms use following command to start MySQL Service.
/etc/init.d/mysql startStarting MySQL.. SUCCESS!
Step 4: Initial MySQL Configuration
/usr/bin/mysql_secure_installationNOTE: RUNNING ALL THE STEPS FOLLOWING THIS IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter password: [ Get password from '/root/.mysql_secret' ]The existing password for the user account has expired. Please set a new password. New password: Re-enter new password: OK, successfully used password, moving on... VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin? Press y|Y for Yes, any other key for No: yThere are three levels of password validation policy. Please enter 0 for LOW, 1 for MEDIUM and 2 for STRONG: 2Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. You already have a root password set. Strength of the password: 50 Change the root password? (Press y|Y for Yes, any other key for No) : n... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : ySuccess.. Moving on.. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : yDone.. Moving on.. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y- Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y... Success! All done! If you've completed all of the above steps, your MySQL installation should now be secure.
Step 5: Login to MySQL
Congratulations! You have successfully installed MySQL 5.7. Let login to MySQL using root access and try to create a dummy database. Use password you have assigned in Step #4.
mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 6 Server version: 5.7.2-m12 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql>
Create a dummy database using following command.
create database dummydb;Query OK, 1 row affected (0.01 sec)
Step 6: Check MySQL Version
Verify your MySQL version installed on your system. Following command will display installed MySQL version.
# mysql -Vmysql Ver 14.14 Distrib 5.7.2-m12, for Linux (x86_64) using EditLine wrapper