CentOS 6.5 i386 installation MySQL 5.7.18 detailed tutorial

CentOS 6.5 i386 installation MySQL 5.7.18 detailed tutorial

Most people compile MySQL and put it in the system directory, but my method is to put the compiled file in the specified directory

In order to enable multiple MySQL instance processes to be started on the same machine

Each instance does not affect each other. No root permission is required

Download CentOS6.5_X86 and install it based on Basic Server

http://archive.kernel.org/centos-vault/6.5/isos/i386/CentOS-6.5-i386-bin-DVD1.iso

MySQL official download https://dev.mysql.com/downloads/mysql/

MySQL online documentation/download https://dev.mysql.com/doc/refman/5.7/en/

MySQL compilation options documentation https://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html

Install dependencies:

[root@CentOS ~]# yum install cmake
[root@CentOS ~]# yum install gcc
[root@CentOS ~]# yum install gcc-c++
[root@CentOS ~]# yum install readline
[root@CentOS ~]# yum install ncurses-devel
[root@CentOS ~]# yum install bison
[root@CentOS ~]# rm -rf /etc/my.cnf /etc/mysql/my.cnf

Download, compile, and install MySQL management software

[root@CentOS ~]# useradd mysql
[root@CentOS ~]# su - mysql
[mysql@CentOS ~]$ wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.7/mysql-boost-5.7.18.tar.gz
[mysql@CentOS ~]$ tar xf mysql-boost-5.7.18.tar.gz
[mysql@CentOS ~]$ cd mysql-5.7.18/
[mysql@CentOS mysql-5.7.18]$ \
rm -rf CMakeCache.txt; \
make clean; \
cmake . \
-DWITH_BOOST=boost/boost_1_59_0/ \
-DCMAKE_INSTALL_PREFIX=${HOME}/MySQL/ \
-DCMAKE_BUILD_TYPE=Release \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STPRAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWIYH_READLINE=1 \
&& make && make install
[mysql@CentOS mysql-5.7.18]$ echo $?
0

Write a configuration file for the database management software

[mysql@CentOS ~]$ cd ${HOME}/MySQL
[mysql@CentOS MySQL]$ mkdir -p ~/MySQL/etc
[mysql@CentOS MySQL]$ vim etc/my.cnf
[chunli@CentOS MySQL_5.7.18]$ cat etc/my.cnf 
[client]
port=3306
socket=/tmp/mysql.sock_001
[mysqld]
#mysqld basic settings port = 3311
log-error = /home/mysql/MySQL/mysql-error.log
pid-file = /home/mysql/MySQL/mysql.pid
basedir = /home/mysql/MySQL
datadir = /home/mysql/MySQL/data
port=3306 #The default is 3306
log-error = mysql-error.log
socket = /tmp/mysql.sock_001  
pid-file = mysql.pid  
default-time-zone = '+8:00'
#mysqld binary log related log-bin=mysql-bin #Open binary log function server_id=1000001 #To open binary, you must specify serverID
binlog_format = mixed
binlog_cache_size = 4M
max_binlog_cache_size = 8M
max_binlog_size = 1G
#mysqld performance related max_connections = 3000 #Specify the maximum number of connection processes allowed by the mysql service max_allowed_packet = 4M #Set the maximum value of a message that can be transmitted at one time during network transmission. The system defaults to 1M
sort_buffer_size = 16M #The sort buffer is used to process sorting caused by orderby and groupby queues. The system default size is 2M
join_buffer_size = 8M #The size of the buffer used for joint query operationsthread_cache_size = 64 #Set the maximum number of connection threads that can be cached in the threadcache pool. The default is 0, which means that the number of threads stored in the cache can be reusedquery_cache_size = 64M #Specify the size of the mysql query buffer, which is used to buffer the results of select, and the next time the same query is performed, the query will no longer be executed but the results will be returned directlyquery_cache_limit = 4M #Only results smaller than this value are buffered, and a very large result will cover all other query resultstmp_table_size = 256M #The size of the temporary table in memory. If it exceeds this value, the temporary table will be written to diskdefault_storage_engine = InnoDB #The default storage engine used when creating a tablekey_buffer_size = 384M #Specify the size of the index buffer. Set it to 256M or 384M when the memory is 4G

All the configuration file parameters are here:

[mysql@CentOS ~]$ /home/mysql/MySQL/bin/mysqld --verbose --help

Create a data warehouse on disk and generate warehouse files:

[mysql@CentOS mysql-5.7.18]$ cd ${HOME}/MySQL
[mysql@CentOS MySQL]$ mkdir -p data; 
[mysql@CentOS MySQL]$ rm -rf data/*; ./bin/mysqld --initialize

Get temporary password: Aa8gjN3k2K/a

Start, Shutdown, Login

[mysql@CentOS MySQL]$ bin/mysqld_safe & #Start MySQL service and run the warehouse file with a process [root@CentOS MySQL]# ./bin/mysqladmin -uroot -p shutdown #Shut down MySQL service [mysql@CentOS ~]$ ./MySQL/bin/mysql -hlocalhost -uroot -p #Log in to MySQL
Enter password: Enter the temporary password you just got

Change the password immediately and cancel the MySQL root remote login restriction

ALTER USER USER() IDENTIFIED BY 'root';
use mysql; 
select host, user from user;
update user set host = '%' where user = 'root';
select host, user from user;
FLUSH PRIVILEGES;

MySQL related file paths

MySQL program path /home/laowang/MySQL_5.7.18

Database file storage path /home/laowang/MySQL_5.7.18/data

MySQL error log path /home/laowang/MySQL_5.7.18/data/CentOS.err

MySQL service process PID /home/laowang/MySQL_5.7.18/data/CentOS.pid-file

So far, a new MySQL instance is completed.

Repeat the steps of [download, compile, and install MySQL management software] and slightly modify the configuration file to install multiple MySQL instances.

The above is a detailed tutorial on how to install MySQL 5.7.18 on CentOS 6.5 i386. 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. Thank you very much for your support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Detailed tutorial for installing mysql5.7.18 on centos7.3
  • Alibaba Cloud Centos7.3 installation mysql5.7.18 rpm installation tutorial
  • CentOS7 uses rpm package to install mysql 5.7.18
  • Detailed tutorial on how to install MySQL 5.7.18 in Linux (CentOS 7) using YUM
  • Installation of mysql-community-server. 5.7.18-1.el6 under centos 6.5
  • MySQL 5.7.18 installation and configuration method graphic tutorial (CentOS7)
  • Linux CentOS MySQL 5.7.18 5.7.X Installation Tutorial
  • CentOS6.8 uses cmake to install MySQL5.7.18
  • Detailed tutorial on installing MySQL 5.7.18 under CentOS 6.5
  • How to install and modify the initial password of mysql5.7.18 under Centos7.3

<<:  In-depth explanation of Vue multi-select list component

>>:  Solution to the same IP after cloning Ubuntu 18 virtual machine

Recommend

MySQL series: Basic concepts of MySQL relational database

Table of contents 1. Basic Concepts 2. Developmen...

How to use javascript to do simple algorithms

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

How to Install Oracle Java 14 on Ubuntu Linux

Recently, Oracle announced the public availabilit...

Native js to achieve puzzle effect

This article shares the specific code of native j...

A record of the pitfalls of the WeChat applet component life cycle

The component lifecycle is usually where our busi...

How to make a tar file of wsl through Docker

I've been playing with the remote development...

Detailed tutorial on installing mysql 5.7.26 on centOS7.4

MariaDB is installed by default in CentOS, which ...

An in-depth introduction to React refs

1. What is Refs is called Resilient File System (...

Centos builds chrony time synchronization server process diagram

My environment: 3 centos7.5 1804 master 192.168.1...

Docker file storage path, get container startup command operation

The container has already been created, how to kn...

MySQL 4G memory server configuration optimization

As the number of visits to the company's webs...

In-depth understanding of MySQL long transactions

Preface: This article mainly introduces the conte...