Mysql installation, configuration, optimization

Reference: http://www.cnblogs.com/zhangan/

First, the  environment to prepare

1.  Download the software package

wget http://test.hexin.cn/software/mysql-5.7.9.tar.gz -P /usr/local/src/

wget http://test.hexin.cn/software/cmake-3.4.0.tar.gz -P /usr/local/src/

wget http://test.hexin.cn/software/boost_1_59_0.tar.gz -P /usr/local/src/

2.  installed base software

yum -y install make gcc-c++ bison-devel ncurses-devel

Second, the  installation configuration My SQL

1.  compile and install cmake

tar zxvf /usr/local/src/cmake-3.4.0.tar.gz

cd /usr/local/src/cmake-3.4.0

./configure && make && make install

2.  compile and install boost (without boost compile time, you can not install this software)

tar zxvf /usr/local/src/boost_1_59_0.tar.gz -C /usr/local/boost/

cd /usr/local/boost/

./bootstrap.sh

./b2

3.  Add User Group

groupadd mysql

useradd mysql -g mysql -M -s /sbin/nologin

4.  Compile installation My SQL

tar zxvf /usr/local/src/mysql-5.7.9.tar.gz

cd /usr/local/src/mysql-5.7.9/

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock  -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

make

make install

Third, the common configuration parameters

● "-prefix": setting the installation path, the default is "/ usr / local";
● "-datadir": setting MySQL data file storage path;
● "the -with-charset": set the default character set system;
● "-with-collation": default validation rules;
● "Extra-the -with-the charsets": a character set to the default character set require compilation and installation;
● "the -with-path-UNIX-Socket" : set the socket file address;
● "the -with-tcp-port": specify a specific listening port, default is 3306;
● "the -with-mysqld-the user": Specifies the user mysqld runs os, the default is MySQL;
● "- without-query-cache ": Query Cache function is disabled;
●" --without-InnoDB ": disable Innodb storage engine;
●" --with-partition ": open partition support features in version 5.1;
●" --enable-the Thread -safe-client ": to compile threads clients;
●" the -with-pthread ": mandatory use of pthread thread library compiled;
●" the -with-named-the thread-libs ": specify the use of a particular thread Compile;
● "--without-debug": a non-debug mode;
● "the -with-mysqld-LDFLAGS": mysqld the additional link parameters;
● "-with-client-ldflags": additional link parameters of the client;

 

Guess you like

Origin www.cnblogs.com/ssgang1037713731/p/12005693.html