The source code of MySQL5.5 is compiled using cmake, which is different from the previous version. The following is a complete compilation and installation process:
1. Download
Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.28.tar.gz/from/http://cdn.mysql.com/
2. Install some tools required to compile mysql5.5
Yum install gcc-c ++ cmake ncurses-devel bison-y
3. Create a user
/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql
4. Decompress, compile, and install
Tar xzvf mysql *
Cd mysql *
CFLAGS = "-O3" CXX = gcc CXXFLAGS = "-O3-felide-constructors-fno-exceptions-fno-rtti" cmake-DMYSQL_USER = mysql \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_DATADIR =/var/lib/mysql \
-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock \
-DEXTRA_CHARSETS = all \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DWITH_EMBEDDED_SERVER = 1 \
-DSERVER-SUFFIX = EMTXDotCom \
-DWITH_DEBUG = 0
Make & make install
5. Some appropriate settings after compilation and installation (Directory permission, startup, etc)
Chmod + w/usr/local/mysql
Chown-R mysql: mysql/usr/local/mysql
Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
Chmod 755/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig -- level 3 mysqld on
Cp support-files/my-huge.cnf/etc/my. cnf
/Usr/local/mysql/scripts/mysql_install_db -- user = mysql -- defaults-file =/etc/my. cnf -- basedir =/usr/local/mysql/-- datadir =/var/lib/mysql/
Echo "export PATH =/usr/local/mysql/bin: $ PATH">/etc/profile
Source/etc/profile
From the above, it seems that the installation and editing of mysql is much simpler than that of php, and configuring permissions is a key point of this installation, because directory operations are required.