Download the rpm installation package MySQL official website: https://dev.mysql.com/downloads/mysql/ Select version to download: You can use the wget command to download: [root@localhost opt]#wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.20-1.el6.x86_64.rpm-bundle.tar Pay attention to the RedHat version and system bitness. View dependent libraries [root@localhost opt]# yum search libaio [root@localhost opt]# yum install libaio Check whether the system has installed MySQL related versions before [root@localhost opt]# rpm -qa | grep mysql [root@localhost opt]# rpm -qa | grep mariadb Delete as many as you have. [root@localhost opt]# rpm -e mariadb-libs-5.5.44-2.el7.x86_64 --nodeps Install Install the packages in order [root@localhost opt]# rpm -ivh mysql-community-common-5.7.20-1.el6.x86_64.rpm [root@localhost opt]# rpm -ivh mysql-community-libs-5.7.20-1.el6.x86_64.rpm [root@localhost opt]# rpm -ivh mysql-community-client-5.7.20-1.el6.x86_64.rpm [root@localhost opt]# rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm Create mysql user and user group [root@localhost /]# groupadd mysql [root@localhost /]# useradd -r -g mysql -s /bin/false mysql Create a mysql data storage directory [root@localhost /]# mkdir -p /data/mysql [root@localhost /]# chown mysql.mysql /data/mysql [root@localhost /]# ll -d /data/mysql/ drwxr-xr-x. 2 mysql mysql 6 9月17 17:37 /data/mysql/ Modify the /etc/my.cnf configuration file [mysqld] init-connect='SET NAMES utf8mb4' default-storage-engine=INNODB character-set-server=utf8mb4 datadir=/data/mysql socket=/var/lib/mysql/mysql.sock assorted security risks symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid validate_password=off sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION lower_case_table_names=1 [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4 Initialize mysql [root@localhost /]# /usr/sbin/mysqld --initialize --user=mysql View the initialization password [root@localhost /]# grep "root@localhost" /var/log/mysqld.log Log in to mysql and change the password mysql> set password = password('123456'); Allow remote access (not recommended) mysql> use mysql; mysql> select host,user,password from user; mysql> update user set password=password('xxxxxx') where user='root'; mysql> update user set host='%' where user='root' and host='localhost'; mysql> flush privileges; Summarize The above is a detailed tutorial on how to install MySQL 5.7.20 on RedHat 6.5/CentOS 6.5. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Summary of twelve methods of Vue value transfer
>>: View the dependent libraries of so or executable programs under linux
Basic syntax: <input type="hidden" na...
If the field storing the name uses the GBK charac...
Anti-shake: Prevent repeated clicks from triggeri...
The default database of CentOS7 is mariadb, but m...
Introduction to Load Balancing Before introducing...
To set the line spacing of <p></p>, us...
This article is welcome to be shared and aggregat...
MySQL is a relational database management system....
Prerequisite: Mac, zsh installed, mysql downloade...
Web Services are concerned with application-to-ap...
1. Arrow Function 1. Take advantage of the fact t...
In MySQL 8.0.18, a new Hash Join function was add...
Solution to MySQLSyntaxErrorException when connec...
Preface When I was working on a project recently,...
1. Mirror images disappear in 50 and 93 [root@h50...