How to install Mysql5.7 in Centos6

How to install Mysql5.7 in Centos6

environment

Centos 6.6

MySQL 5.7

Install

If the system has been installed, please uninstall it first!

Disable Selinux

setenforce 0 (temporary shutdown) Modify /etc/selinux/config (permanent shutdown)
Change SELINUX=enforcing to SELINUX=disabled

1. Download the dependency package and mysql installation package

Download and unzip from the official website:

wget http://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.15-1.el6.x86_64.rpm-bundle.tar
tar -xvf mysql-5.7.15-1.el6.x86_64.rpm-bundle.tar

2. Installation

rpm -ivh mysql-community-common-5.7.15-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.15-1.el6.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.15-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.15-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.15-1.el6.x86_64.rpm

(1) For MySQL 5.7.6 and higher, the initial random root password is written to the log (default location: /var/log/mysqld.log)

(2) Do not create a MySQL anonymous account

(3) Do not create a test database

3. Start mysqld

If the mysql user is missing, create it yourself;

adduser -g mysql mysqlysql

Before starting, you need to check whether the data directory exists, as follows:

If the data directory does not exist, mysqld creates it.

If the data directory exists and is not empty (i.e. contains files or subdirectories)

service mysqld start

Change the root login password

mysql –uroot –p

The password entered here is the initial password generated under /var/log/mysqld:

alter user 'root'@'localhost' identified by 'Mysql$%123';

If necessary, use the initialization command:

mysqld --initialize --user=mysql (in secure mode)
mysqld --initialize-insecure --user=mysql (insecure mode)

4. Check whether MySQL starts automatically and set it to start automatically

chkconfig --list | grep mysqld
chkconfig mysqld on

Version Changes

thread_concurrency

5.7 The default setting is 0, which means there is no limit on the number of concurrent connections. It is recommended to set it to 0 to better utilize the multi-core processing capabilities of the CPU and increase the amount of concurrency. Starting from MySQL 5.6.1, this option has been abolished.

The above is the installation method of Mysql5.7 in Centos6 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time!

You may also be interested in:
  • Centos6.9 installation Mysql5.7.18 step record
  • CentOS6.9+Mysql5.7.18 source code installation detailed tutorial
  • 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
  • Centos6.5 compile and install mysql 5.7.14 detailed tutorial

<<:  Detailed explanation of Nginx's control over access volume

>>:  Detailed explanation of Vue configuration request multiple server solutions

Recommend

HTML table only displays the outer border of the table

I would like to ask a question. In Dreamweaver, I...

Detailed explanation of the usage and difference between nohup and & in Linux

Example: We use the Python code loop_hello.py as ...

HTML design pattern daily study notes

HTML Design Pattern Study Notes This week I mainl...

Skin change solution based on Vue combined with ElementUI

Table of contents Written in front Solution 1: Us...

Summary of Creating and Using Array Methods in Bash Scripts

Defining an array in Bash There are two ways to c...

Docker enables seamless calling of shell commands between container and host

As shown below: nsenter -t 1 -m -u -n -i sh -c &q...

Take you to understand MySQL character set settings in 5 minutes

Table of contents 1. Content Overview 2. Concepts...

MySQL series 9 MySQL query cache and index

Table of contents Tutorial Series 1. MySQL Archit...

The difference between char and varchar in MYSQL

CHAR and VARCHAR types are similar, differing pri...

IDEA complete code to connect to MySQL database and perform query operations

1. Write a Mysql link setting page first package ...

How to use javascript to do simple algorithms

Table of contents 1 Question 2 Methods 3 Experime...

How to solve the problem of case insensitivity in MySQL queries

question Recently, when I was completing a practi...

Summary of methods for finding and deleting duplicate data in MySQL tables

Sometimes we save a lot of duplicate data in the ...

...