CentOS 6.5 i386 install MySQL 5.7.18

Source: Internet
Author: User


Most of them are compiled into the system directory.

My way is to put the compiled file in the specified directory

Multiple MySQL instance processes can be opened for the same machine

Each instance does not affect each other. Root privileges are not required




Download Centos6.5_x86 installation 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 Document https://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html




Installation dependencies:

[[email protected] ~]# yum install cmake[[email protected] ~]# yum install gcc[[email protected] ~]# Yum install gcc-c++[[ Email protected] ~]# yum install readline[[email protected] ~]# yum install ncurses-devel[[email protected] ~]# yum instal L Bison[[email protected] ~]# rm-rf/etc/my.cnf/etc/mysql/my.cnf



Download, compile, install MySQL management software

[[email protected] ~]# useradd mysql[[email protected] ~]# su -  mysql[[email protected] ~]$ wget http://ftp.iij.ad.jp/pub/db/mysql/downloads/mysql-5.7/ mysql-boost-5.7.18.tar.gz[[email protected] ~]$ tar xf mysql-boost-5.7.18.tar.gz[[ email protected] ~]$ cd mysql-5.7.18/[[email protected] 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[[email protected] mysql-5.7.18]$ echo  $?0


Write a configuration file for the database management software

[[Email protected] ~]$ cd ${home}/mysql[[email protected] mysql]$ mkdir  -p ~/mysql/etc[[email protected] mysql]$ vim etc/my.cnf[[email protected]  MySQL_5.7.18]$ cat etc/my.cnf [client]port=3306socket=/tmp/mysql.sock_001[mysqld]#  MYSQLD Basic Settings port = 3311log-error = /home/mysql/mysql/mysql-error.logpid-file = / home/mysql/mysql/mysql.pidbasedir = /home/mysql/mysqldatadir = /home/mysql/mysql/dataport= 3306   #默认就是3306log-error = mysql-error.logsocket = /tmp/mysql.sock_001        pid-file = mysql.pid       default-time-zone =  ' # mysqld binary log related log-bin=mysql-bin         #打开二进制日志功能server_id =1000001        #打开二进制必须指定serverIDbinlog_format  = mixedbinlog_cache_sizE = 4MMAX_BINLOG_CACHE_SIZE = 8MMAX_BINLOG_SIZE = 1G# MYSQLD Performance-related Max_ connections = 3000   #指定mysql服务所允许的最大连接进程数max_allowed_packet  = 4m # Set the maximum number of messages that can be transmitted at one time in the network transmission, the system defaults to 1msort_buffer_size = 16m   #排序缓冲区用来处理类似orderby以及groupby队列所引起的排序, The system default size is 2mjoin_buffer_size = 8m    #联合查询操作所使用的缓冲区大小thread_cache_size  = 64    #设置threadcache池中可以缓存连接线程的最大数量, the default is 0, which means that the number of threads saved in the cache can be re-used query_cache_size = 64m    #指定mysql查询缓冲区的大小, used to buffer the results of a select and return results directly at the next time the query is no longer executed query_cache_limit = 4m  # Only results that are smaller than this value are buffered, placing a large result that overwrites all other query results with the tmp_table_size = 256m    #内存临时表的大小, if the value is exceeded, Writes temporary tables to disk default_storage_engine = innodb  #创建表时默认使用的存储引擎key_buffer_size  = 384M    #指定索引缓冲区的大小, the memory is set to 256M or 384M configuration file at 4G time all parameters here: [[[Email protected] ~]$ /home/mysql/mysql/bin/ Mysqld --verbose --help


Create the Data warehouse on disk and generate the warehouse files:

[Email protected] mysql-5.7.18]$ CD ${home}/mysql[[email protected] mysql]$ mkdir-p data; [Email protected] mysql]$ RM-RF data/*;/bin/mysqld--initialize get temporary password: aa8gjn3k2k/a


Start, close, login

[[email protected] mysql]$ Bin/mysqld_safe & #启动MySQL服务, run the warehouse file with the process [[email protected] mysql]#./bin/mysqladmin- uroot-p shutdown #关闭MySQL服务 [[email protected] ~]$./mysql/bin/mysql-hlocalhost-uroot-p #登陆MySQLEnter Password: input just got Temporary password Change password immediately, cancel MySQL root remote login limit alter USER user () identified by ' Root '; Select Host, user from user;update user set host = '% ' where user = ' root '; Select host, user from user; FLUSH privileges;


MySQL Related file path

MySQL Program path /home/laowang/mysql_5.7.18

database File storage path /home/laowang/mysql_5.7.18/data

error log path for MySQL /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 has been completed,

Repeat the [ download, compile, install MySQL management software ] step to install multiple MySQL instances by modifying the configuration file slightly.


This article is from the "Li Chunli" blog, make sure to keep this source http://990487026.blog.51cto.com/10133282/1916371

CentOS 6.5 i386 install MySQL 5.7.18

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.