First, install the Yum source
Get the Epel version of the CentOS version from the address below, which will help with Yum installation software in the future
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Installing the Epel Package
RPM-IVH epel-release-6-8.noarch.rpm
Second, install MySQL
Install the necessary packages
Yum install cmake gcc gcc-c++ ncurses-devel perl
Download the MySQL installation package, mysql-5.5 the installation package, and unzip the installation package
TAR-ZXVF mysql-5.5.32.tar.gz CD mysql-5.5.32
Compiling the installation
Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data/mysqldb-dwith_innobase_storage_engine=1- Dwith_federated_storage_engine=1-dwith_blackhole_storage_engine=1 \-dwith_example_storage_engine=1 \-DWITH_ partition_storage_engine=1 \-dwith_fast_mutexes=1 \-dwith_zlib=bundled \-denabled_local_infile=1 \-DWITH_READLINE= 1-dwith_embedded_server=1-dmysql_unix_addr=/usr/local/mysql/mysql.sock-denabled_local_infile=on-ddefault_ Charset=utf8-ddefault_collation=utf8_general_ci-dwith_debug=0make && make Install
Third, configure user rights
Set up MySQL users and groups
Groupadd mysqluseradd-g MySQL MySQL
New MySQL installation directory and data file directory
Mkdir-p/usr/local/mysqlmkdir-p/data/mysqldb
Modify Directory Owners and groups
Chown-r Mysql:mysql/usr/local/mysqlchown-r Mysql:mysql/data/mysqldb
Iv. initializing the database, configuring the configuration file, configuring the boot file, etc.
cd/usr/local/mysqlscripts/mysql_install_db--user=mysql--datadir=/data/mysqldb--basedir=/usr/local/mysql
Copy the MySQL service startup configuration file, my.cnf the data to overwrite it
Cp/usr/local/mysql/support-files/my-small.cnf/etc/my.cnf
Copy the MySQL service startup script
CP Support-files/mysql.server/etc/init.d/mysqld
Modify the/etc/profile file to add the path at the end
Path=/usr/local/mysql/bin: $PATHexport PATH
Save changes to make the configuration take effect immediately
Source/etc/profile
V. Start the database and log in
Service mysqld Start
Log in to Database
Mysql-uroot
This article is from the "Database learning process" blog, so be sure to keep this source http://yuemu.blog.51cto.com/10688235/1868159
MySQL compilation installation