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

An article to understand the use of proxies in JavaScript

Table of contents What is an agent Basic knowledg...

Detailed explanation of MySQL's Seconds_Behind_Master

Table of contents Seconds_Behind_Master Original ...

UDP connection object principle analysis and usage examples

I wrote a simple UDP server and client example be...

Introduction to TypeScript interfaces

Table of contents 1. Interface definition 2. Attr...

Specific steps to use vant framework in WeChat applet

Table of contents 1. Open the project directory o...

Designing the experience: What’s on the button

<br />Recently, UCDChina wrote a series of a...

Detailed explanation of MySQL combined index and leftmost matching principle

Preface I have seen many articles about the leftm...

mysql5.7 create user authorization delete user revoke authorization

1. Create a user: Order: CREATE USER 'usernam...

A graphic tutorial on how to install MySQL in Windows

Abstract: This article mainly explains how to ins...

Vue commonly used high-order functions and comprehensive examples

1. Commonly used high-order functions of arrays S...

Useful codes for web page creation

<br />How can I remove the scroll bar on the...

Implementation code of front-end HTML skin changing function

50 lines of code to change 5 skin colors, includi...

Zabbix implements monitoring of multiple mysql processes

Three MySQL instance processes are started on one...