Blink of an eye has been to 2015, the past few months, learning a lot of things, but also summed up a lot, during the encounter many problems, many of them are search without fruit, and then their own research, thinking more also want to share their own things, although not the best, but also absolutely enough to cope with some problems at work, If there is a problem with the content, please correct me to help the niche progress, thank you.
This article takes mysql5.5.40 as an example, the process has only a few words to explain, may need to understand some basic knowledge to understand.
This article is for rapid deployment, use can be directly copied and pasted, in addition as a backup, easy to see later, and MySQL is almost configured to use 3, 5 years.
====================================== Body begins ======================================
================================== Pre-installation condition preparation ==================================
Document usage software version: mysql-5.5.40.tar.gz
SOURCE Package Storage Path:/server/soft
MySQL Installation path:/usr/local/mysql
Data storage path:/data0/mysql/data
Turn off SELINUX (recommended off): Sed-i ' s#selinux=enforcing#selinux=disabled#g '/etc/selinux/config && setenforce 0 & & Getenforce
Close iptables (recommended off):/etc/init.d/iptables stop
The compilation environment is determined (it is recommended to do this once to avoid missing some of the compiled environment Plug-ins):
Yum install make CMake apr* autoconf automake Curl curl-devel gcc gcc-c++ gtk+-devel zlib-devel OpenSSL openssl-devel pcre -devel gd kernel keyutils patch perl kernel-headers compat* cpp glibc libgomp libstdc++-devel keyutils-libs-devel Libsepo L-devel libselinux-devel krb5-devel libxpm* freetype freetype-devel freetype* fontconfig fontconfig-devel libjpeg* LIBPN g* Php-common php-gd gettext gettext-devel ncurses* libtool* libxml2 libxml2-devel patch policycoreutils bison-y
====================================== installation Process ======================================
Groupadd MySQL
Useradd-g mysql-s/sbin/nologin-m MySQL
Mkdir-p/data0/mysql
Chown-r Mysql.mysql/data0/mysql
Mkdir-p/usr/local/mysql
Chown-r Mysql.mysql/usr/local/mysql
Mkdir/server/soft-p
Cd/server/soft
wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.40.tar.gz
Tar zxf mysql-5.5.40.tar.gz
CD mysql-5.5.40
Cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/data0/mysql \
-dmysql_unix_addr=/usr/local/mysql/tmp/mysql.sock \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_readline=1 \
-dwith_ssl=system \
-denabled_local_infile=1 \
-dwith_innobase_storage_engine=1
Make && make install
====================================== Configuration Process ======================================
/bin/cp/server/soft/mysql-5.5.40/support-files/my-small.cnf/etc/my.cnf
Note: The test environment chooses the small small, the production environment chooses the different configuration file according to the need, for example: MY-INNODB-HEAVY-4G.CNF
Sed-i ' s: #innodb: Innodb:g '/etc/my.cnf
Echo ' path= $PATH:/usr/local/mysql/bin ' >>/etc/profile
Source/etc/profile
/usr/local/mysql/scripts/mysql_install_db--defaults-file=/etc/my.cnf--basedir=/usr/local/mysql--datadir=/data0 /mysql--user=mysql
Cp/server/soft/mysql-5.5.40/support-files/mysql.server/etc/init.d/mysqld
chmod 700/etc/init.d/mysqld
/etc/init.d/mysqld start
Chkconfig mysqld on
Lsof-i: 3306
/usr/local/mysql/bin/mysqladmin-u root Password 111111 (here 111111 is the password you want to set)
Mysql-uroot-p111111-e "select version ();"
This article is from the "Fish Sheep" blog, please be sure to keep this source http://iyuyang.blog.51cto.com/2305553/1604600
MySQL version 5.5 and later quickly compile the installation, directly copy and paste just fine, close to unattended