How to Install Latest MySQL 5.7.9 on Centos/RHEL 6x
Step: 1. Download the MySQL 5.7 Repository :
# cd /tmp
# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm (For RHEL/CentOS 6)
# wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm (For RHEL/CentOS 7)
Step: 2. Install MySQL 5.7 Repository :
# yum localinstall mysql57-community-release-el6-7.noarch.rpm (For RHEL/CentOS 6)
# yum localinstall mysql57-community-release-el7-7.noarch.rpm (For RHEL/CentOS 7)
Step: 3. Verify that the MySQL Yum Repository has been Added Successfully :
# yum repolist enabled | grep "mysql.*-community.*"
Step: 4. Installing Latest MySQL Version :
# yum -y install mysql-community-server
Step: 5. To Install Specific Version of MySQL from Specific Sub-Repository (Optional):
Note: You can also install different MySQL version using different sub-repositories of MySQL Community Server. MySQL series (currently MySQL 5.7) is activated by default, and the sub-repositories for all other versions (for example, the MySQL 5.6 or 5.5 series) are Deactivated by Default.
# yum-config-manager --disable mysql57-community
# yum-config-manager --enable mysql56-community
Then Run:
# yum repolist enabled | grep "mysql.*-community.*"
# yum -y install mysql-community-server
Step: 6. Start the MySQL Server :
# service mysqld restart
# chkconfig mysqld on
Step: 7. Change the MySQL Password Policy :
# vi /etc/my.cnf
Add these 3 lines below [mysqld]
validate_password_policy=LOW
validate_password_length=6
validate_password_dictionary_file=YES
validate_password_special_char_count =0
validate_password_mixed_case_count = 0
-- Save & Quit (:wq)
# service mysqld restart
Step: 8. Set MySQL Root Password :
# grep 'temporary password' /var/log/mysqld.log
Output: A temporary password is generated for root@localhost: zB#cXVhVb3(c
Step: 9. Check the root Login & Password Policy :
# mysql - u root -p
Enter password: zB#cXVhVb3(c
mysql> SHOW VARIABLES LIKE 'validate_password%';
+----------------------------------------+--------+
| Variable_name | Value |
+----------------------------------------+--------+
| validate_password_dictionary_file | |
| validate_password_length | 6 |
| validate_password_mixed_case_count | 0 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 0 |
+----------------------------------------+--------+
6 rows in set (0.07 sec)
mysql> exit
Step: 10. Change the Root Password :
# mysql_secure_installation
Enter password for user root: zB#cXVhVb3(c
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
New password: redhat123
Re-enter new password: redhat123
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Step: 11. Allow Root Login from Remote :
# mysql -u root -predhat123
mysql> grant all privileges on *.* to root@'%' identified by 'redhat123' with grant option;
mysql> exit
Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog
0 comments:
Post a Comment