1. Installation Preparation
cat/etc/redhat-release uname-r yum install ncurses-devel cmake automake autoconf make gcc gcc-c+ + bison-y mkdir /application/data-p groupadd MySQL useradd -g mysql -s /sbin/nologin-m mysql |
2. Source code installation
CD Tools Tar XF mysql-5.5.46.tar.gz CMake.-dcmake_install_prefix=/application/mysql-5.5.46 \ -dmysql_datadir=/application/data \ -dmysql_unix_addr=/application/mysql-5.5.46/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_myisam_storage_engine=1 \ -dwith_federated_storage_engine=1 \ -dwith_blackhole_storage_engine=1 \ -dwithout_example_storage_engine=1 \ -dwithout_partition_storage_engine=1 \ -dwith_fast_mutexes=1 \ -dwith_zlib=bundled \ -denabled_local_infile=1 \ -dwith_readline=1 \ -dwith_embedded_server=1 \ -dwith_debug=0 Make && makeinstall |
3.Mysql initialization and configuration
CP support-files/my-small.cnf/etc/my.cnf cd /application chown-r mysql.mysql data chmod-r 1777/tmp/ cd/application/mysql/scripts/ ./mysql_install_db--basedir=/application/mysql &NBSP, --datadir=/application/data--user=mysql |
4. Join the boot start
/etc/init.d/mysqld chmod +x/etc/init.d/mysqld chkconfig--add mysqld chkconfig mysqld on chkconfig mysqld--list /etc/init.d/mysqld start netstat-tunlp|grep mysqld lsof-i:3306 |
5. Setting the MySQL environment variable
echo "path=/application/mysql/bin/: $PATH" >>/etc/profile Source/etc/profile which MySQL |
This article is from the "Lanzhou Linux operation and Maintenance" blog, please be sure to keep this source http://linuxzkq.blog.51cto.com/9379412/1700082
mysql-5.5.46 Source Code Compilation installation