CentOS 6.4 MySQL 5.7.18 installation and configuration method graphic tutorial

CentOS 6.4 MySQL 5.7.18 installation and configuration method graphic tutorial

The specific steps of installing mysql5.7.18 under centos6.4 are shared with everyone.

1. First check whether MySQL has been installed and find the MySQL related software rpm package

#rpm -qa | grep mysql

2. Delete everything related to mysql

#yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64

3. Install dependency packages

#yum -y install make gcc-c++ cmake bison-devel ncurses-devellibaio libaio-devel

4. Create a mysql user group

#groupadd mysql

5. Create user mysql under the mysql user group

#useradd mysql -g mysql

6. Download mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz from the official website

Download address: https://dev.mysql.com/downloads/mysql/

7. Put mysql-5.7.19-linux-glibc2.12-x86_64.tar in the /opt folder

8. Unzip the file mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

#tar xzvfmysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

9. Rename mysql-5.7.19-linux-glibc2.12-x86_64 to mysql and move it to /usr/local/mysql

#mv mysql-5.7.19-linux-glibc2.12-x86_64 /usr/local/mysql

Create a data directory under /usr/local/mysql

#mkdir /usr/local/mysql/data

10. Return to the local directory

#cd /usr/local

Change the main content of the mysql directory and the files and subdirectories below it to mysql

#chown -R mysql:mysql mysql/

Grant 755 permissions to the mysql directory and its files and subdirectories

#chmod -R 755 mysql/

11. Compile, install and initialize mysql, remember the password at the end of the command line

#/usr/local/mysql/bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql

12. Start the mysql service

#/usr/local/mysql/support-files/mysql.server start

13. Make a soft connection and restart the MySQL service

#ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
#service mysql restart

14. Make a soft link and put mysql in the installation directory in the /usr/bin directory

#ln -s /usr/local/mysql/bin/mysql /usr/bin

15. Log in to msyql and enter the password (the password is the password generated by initialization in step 11)

#mysql -u root -p

16. Change the password to 123456

msql>alter user 'root'@'localhost' identified by '123456';
mysql>use mysql;
msyql>update user set user.Host='%' where user.User='root';
mysql>flush privileges;
mysql>quit

17. Edit my.cnf, add the configuration file, and configure the content as follows

#vi /usr/local/mysql/my.cnf

[mysqld]
port = 3306
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

18. Allow port 3306

#iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
#iptables -L -n
#service iptables save

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed tutorial on installing MySQL 5.7.20 on RedHat 6.5/CentOS 6.5
  • Solution to the initialization error when installing mysql5.7 from rpm package in centos6.5
  • Tutorial on installing and configuring MySql5.7 in Alibaba Cloud ECS centos6.8
  • Centos6.9 installation Mysql5.7.18 step record
  • CentOS6.8 uses cmake to install MySQL5.7.18
  • Detailed tutorial on installing MySQL 5.7.18 under CentOS 6.5
  • Deploy MySQL 5.7.17 binary installation and multi-instance configuration on CentOS 6.5
  • Tutorial on installing MySQL 5.7.28 on CentOS 6.2 (mysql notes)

<<:  React uses emotion to write CSS code

>>:  Solution to slow network request in docker container

Recommend

JavaScript pre-analysis, object details

Table of contents 1. Pre-analysis 1. Variable pre...

Detailed explanation of Javascript Echarts air quality map effect

We need to first combine the air quality data wit...

JavaScript implements page scrolling animation

Table of contents Create a layout Add CSS styles ...

A simple way to build a Docker environment

First, let’s understand what Docker is? Docker is...

Nginx Service Quick Start Tutorial

Table of contents 1. Introduction to Nginx 1. Wha...

How to change password in MySQL 5.7.18

How to change the password in MySQL 5.7.18: 1. Fi...

Some tips for writing high-performance HTML applications

How can you improve web page performance? Most de...

What scenarios are not suitable for JS arrow functions?

Table of contents Overview Defining methods on an...

Analysis of Sysbench's benchmarking process for MySQL

Preface 1. Benchmarking is a type of performance ...

Summary of HTML knowledge points for the front end (recommended)

1. HTML Overview htyper text markup language Hype...

How to configure mysql5.6 to support IPV6 connection in Linux environment

Introduction: This article mainly introduces how ...

Basic Implementation of AOP Programming in JavaScript

Introduction to AOP The main function of AOP (Asp...