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

Some data processing methods that may be commonly used in JS

Table of contents DOM processing Arrays method Su...

CSS Reset style reset implementation example

Introduction: All browsers come with default styl...

Briefly describe the difference between Redis and MySQL

We know that MySQL is a persistent storage, store...

Linux bash: ./xxx: Unable to execute binary file error

Today I sent a small tool for Ubuntu to a custome...

Nginx http health check configuration process analysis

Passive Check With passive health checks, NGINX a...

js to call the network camera and handle common errors

Recently, due to business reasons, I need to acce...

Detailed explanation of Mysql self-join query example

This article describes the Mysql self-join query....

A brief summary of all encapsulation methods in Vue

Table of contents 1. Encapsulation API 2. Registe...

Detailed analysis of the principles and usage of MySQL views

Preface: In MySQL, views are probably one of the ...

Linux debugging tools that developers and operators must look at [Recommended]

System performance expert Brendan D. Gregg update...

Build a Scala environment under Linux and write a simple Scala program

It is very simple to install Scala environment in...

Detailed explanation of Nginx configuration file

The main configuration file of Nginx is nginx.con...