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
After installing the database, if you accidentall...
Preface To solve the single point of failure, we ...
This article mainly introduces how to integrate T...
Notes on installing MySQL database, share with ev...
1.html <div class="loginbody"> &l...
Table of contents Preface: Step 1: Find the free ...
In MySQL, you can use the REVOKE statement to rem...
The traditional method is to write a square in a ...
This article shares the installation and configur...
This article mainly discusses the differences bet...
This article summarizes some simple principles of...
HTML 4 HTML (not XHTML), MIME type is text/html, ...
This article example shares the specific code of ...
Go is an open source programming language that ma...
First, let me briefly introduce what MySQL is; In...