"Single Instance Installation"
Description: Provides only one service, one port
Sed-i 2s/localhost.localdomain/mysql//etc/sysconfig/network
hostname MySQL
Yum-y Install ncurses-devel gcc gcc-c++
Useradd mysql-s/sbin/nologin-m
Tar XF cmake-2.8.8.tar.gz
CD cmake-2.8.8
./configure
Gmake
Gmake Install
Cd..
Tar XF mysql-5.5.32.tar.gz
CD mysql-5.5.32
CMake. -dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-dmysql_unix_addr=/usr/local/mysql/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \
-denabled_local_infile=on \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwithout_partition_storage_engine=1 \
-dwith_zlib=bundled \
-denabled_local_infile=1 \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dwith-debug=0
Make && make install
CP SUPPORT-FILES/MY-SMALL.CNF/ETC/MY.CNF
Ln-s/usr/local/mysql/bin/*/usr/local/sbin
Chmod-r 1777/tmp
Chown-r Mysql:mysql/usr/local/mysql
cd/usr/local/mysql/scripts/
./mysql_install_db--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/--user=mysql
Cp/opt/mysql-5.5.32/support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
Service mysqld Start
Chkconfig mysqld on
Mysql-e "Delete from mysql.user where user= ';"
Mysql-e "Delete from Mysql.user where host= ' Localhost.localdomain ';"
Mysql-e "Delete from Mysql.user where host= ':: 1 ';"
MYSQL-E "drop database test;"
mysqladmin-u root Password "wsyht123"
"Multi-Instance Installation"
Description: Multi-instance, refers to multiple ports, multiple MySQL services provided
Sed-i 2s/localhost.localdomain/mysql//etc/sysconfig/network
hostname MySQL
Yum-y Install ncurses-devel gcc gcc-c++ libaio-devel
Useradd mysql-s/sbin/nologin-m
Tar XF cmake-2.8.8.tar.gz
CD cmake-2.8.8
./configure
Gmake
Gmake Install
Cd..
Tar XF mysql-5.5.32.tar.gz
CD mysql-5.5.32
CMake. -dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-dmysql_unix_addr=/usr/local/mysql/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \
-denabled_local_infile=on \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwithout_partition_storage_engine=1 \
-dwith_zlib=bundled \
-denabled_local_infile=1 \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dwith-debug=0
Make && make install
Ln-s/usr/local/mysql/bin/*/usr/local/sbin
chmod 700/opt/mysql
Mkdir-p/data/{3306,3307,3308}
cp/opt/my.cnf/data/3306/
cp/opt/my.cnf/data/3307/
cp/opt/my.cnf/data/3308/
cp/opt/mysql/data/3306
cp/opt/mysql/data/3307
cp/opt/mysql/data/3308
Chmod-r 1777/tmp
Chown-r Mysql:mysql/data
Chown-r Mysql:mysql/usr/local/mysql
Cd/usr/local/mysql/scripts
./mysql_install_db--basedir=/usr/local/mysql/--datadir=/data/3306/data/--user=mysql
./mysql_install_db--basedir=/usr/local/mysql/--datadir=/data/3307/data/--user=mysql
./mysql_install_db--basedir=/usr/local/mysql/--datadir=/data/3308/data/--user=mysql
/data/3306/mysql start
This article is from the "Technology sharing" blog, so be sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1716894
MySQL single-and dual-instance installation