CentOS 6.5 i386 detailed tutorial on installing MySQL 5.7.18, centos5.7.18

Source: Internet
Author: User
Tags mysql download

CentOS 6.5 i386 detailed tutorial on installing MySQL 5.7.18, centos5.7.18

Most of them are compiling MySQL in the system directory, and my approach is to put the compiled files in the specified directory.

To enable the process of multiple MySQL instances on the same machine

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

Download centos6.5_x86 to install Basic Server-based

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

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

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

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

Install dependency:

[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 = 3311log-error =/home/mysql/MySQL/mysql-error.logpid-file =/home/mysql/MySQL/mysql. pidbasedir =/home/mysql/MySQLdatadir =/home/mysql/MySQL/dataport = 3306 # default is 3306log-error = mysql-error.logsocket =/tmp/mysql. sock_001 pid-file = mysql. pid default-time-zone = '+ 8:00' # mysqld binary log related log-bin = mysql-bin # enable the binary log function server_id = 1000001 # enable the binary function serverIDbinlog_format = mixedbinlog_cache_size = 4Mmax_binlog_cache_size = 8Mmax_binlog_size = 1G # max_connections = 3000 # specify the maximum number of connection processes allowed by the mysql service max_allowed_packet = 4 M # set the maximum number of messages that can be transmitted once during network transmission, the default value is 1Msort_buffer_size = 16 M # The sorting buffer is used to process sorting caused by orderby and groupby queues, the default size is 2Mjoin_buffer_size = 8 M # the buffer size used by the Joint query operation thread_cache_size = 64 # sets the maximum number of connection threads that can be cached in the threadcache pool. The default value is 0, this value indicates that the number of threads saved in the cache can be reused. query_cache_size = 64 M # This parameter specifies the size of the mysql Query Buffer to buffer select results, in the next query, the query_cache_limit = 4 M # result is buffered only when the value is smaller than this value, place a large result to overwrite all other query results with tmp_table_size = 256 M # the size of the memory temporary table. If this value is exceeded, the temporary table will be written to the disk default_storage_engine = InnoDB # The default storage engine key_buffer_size = 384 M # used when creating the table specifies the size of the index buffer, and the memory is set to 384 M or M when 4G is used.

All the parameters in the configuration file are as follows:

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

Create a data warehouse on the disk and generate the warehouse file:

[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 the temporary password: Aa8gjN3k2K/

Start, close, and log on

[Mysql @ CentOS MySQL] $ bin/mysqld_safe & # Start the MySQL service and run the repository file using the process [root @ CentOS MySQL] #. /bin/mysqladmin-uroot-p shutdown # disable MySQL service [mysql @ CentOS ~] $./MySQL/bin/mysql-hlocalhost-uroot-p # log on to MySQLEnter password: Enter the temporary password YOU JUST OBTAINED

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 file path

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 has been completed,

Repeat the steps of [download, compile, and install MySQL management software] To Install Multiple MySQL instances by slightly modifying the configuration file.

The above is a detailed tutorial on installing MySQL 5.7.18 on CentOS 6.5 i386. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner, thank you very much for your support for the help House website!

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.