centos7 mounting MySQL (effective pro-test)

Disclaimer: This article is copyrighted final HrainOne all, welcome to reprint, please declare final copyright https://blog.csdn.net/gaoxin_gx/article/details/90274409

Done a lot of installation, the number of failures before a database about themselves, is simply outrageous ... In retrospect, all the pain, Internet search tutorial, a series of step by step installation Anyway, I have not been successful.
This is a successful installation, and after a successful outcome after several tests, if once again keep after installation, can be installed directly, you do not look for so-called tutorial. Also helps people to this problem, a method is also encountered.

Proceed as follows:

PS:

This is /etc/my.cnf mysql main configuration file
/ var / lib / mysql mysql database file storage location database
log output storage position / var / log mysql database

A: first check whether you install mysql, if installed, uninstall

Command to check whether the installed: rpm -qa | grep mysql
uninstall command: yum -y remove installed mysql name

II: Installation mysql official source

Command:
wget -c -i http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
(probably about 20kb download quickly, do not think small, not down on)

Three: Download rpm package

命令:yum -y install mysql57-community-release-el7-10.noarch.rpm

Four: installation services of MySQL

Command: yum -y install MySQL-Community Community-Server
(this step a long time, it should be said to be a long, wait, you can drink a cup of coffee)

Five: Start the MySQL service

Command: systemctl start mysqld.service

Six: View Temporary Password

Command: grep "password" /var/log/mysqld.log
(last sentence, according to the English meaning to come, behind the colon, is the temporary password)

Seven: Change Password
1: Login
  mysql:mysql -uroot -p
2: Enter the password

(Because the password can not be set too simple, so we have to change it)

3: Modified:
  mysql> set global validate_password_policy=0;
  mysql> set global validate_password_length=1;
4: Change Password:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
5: each update operation to prevent yum
[root@localhost ~]# yum -y remove mysql57-community-release-el7-10.noarch

If what went wrong, comments down, study together, progress together.
For ease of management, the installation of phpmyadmin, graphical database management, please see this: centos7 install phpmyadmin (pro-test available)

Once again, remind yourself: seriously do technology, seriously man! Do not self-deception!

Guess you like

Origin blog.csdn.net/gaoxin_gx/article/details/90274409