Install MySQL5.5.11CMake in centos
BitsCN.com
Installation notes for MySQL 5.5.11 CMake in centos
The latest mysql versions require cmake compilation and installation. it is estimated that this method will be used in future versions. Therefore, we will record the installation steps and procedures for your reference.
Note: This installation is the default centos has installed the latest toolkit, such as GNU make, GCC, Perl, libncurses5-dev, if there is a missing toolkit found during the compilation and installation process, first, download and install yum install separately before continuing.
1. use wget to download the required software from Centos and save it to the/usr/local/src/directory.
Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.11.tar.gz/from/http://mysql.he.net/
Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
Wget http://ftp.gnu.org/gnu/bison/bison-2.4.3.tar.gz
II. install cmake
Cd/usr/local/src
Tar zxvf cmake-2.8.4.tar.gz
Cd cmake-2.8.4
./Bootstrap
Gmake
Gmake install
Cd ../
Tar zxvf bison-2.4.3.tar.gz
Cd bison-2.4.3
./Configure
Make
Make install
Cd ../
III. Compile and install MySQL 5.5.11
/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql
Tar xvf mysql-5.5.11.tar.gz
Cd mysql-5.5.11/
Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql/
-DMYSQL_UNIX_ADDR =/tmp/mysql. sock/
-DDEFAULT_CHARSET = utf8/
-DDEFAULT_COLLATION = utf8_general_ci/
-DWITH_EXTRA_CHARSETS: STRING = utf8, gbk/
-DWITH_MYISAM_STORAGE_ENGINE = 1/
-DWITH_INNOBASE_STORAGE_ENGINE = 1/
-DWITH_MEMORY_STORAGE_ENGINE = 1/
-DWITH_READLINE = 1/
-DENABLED_LOCAL_INFILE = 1/
-DMYSQL_DATADIR =/var/mysql/data/
-DMYSQL_USER = mysql
Make
Make install
Chmod + w/usr/local/mysql
Chown-R mysql: mysql/usr/local/mysql
Ln-s/usr/local/mysql/lib/libmysqlclient. so.16/usr/lib/libmysqlclient. so.16
Mkdir-p/var/mysql/
Mkdir-p/var/mysql/data/
Mkdir-p/var/mysql/log/
Chown-R mysql: mysql/var/mysql/
Cdsupport-files/
Cpmy-large.cnf/var/mysql/my. cnf
Cp mysql. server/etc/init. d/mysqld
4. configure to start MySQL 5.5.11
1. if necessary, first modify mysql configuration my. cnf
Vi/var/mysql/my. cnf
2. mysql initialization and installation
/Usr/local/mysql/scripts/mysql_install_db/
-- Defaults-file =/var/mysql/my. cnf/
-- Basedir =/usr/local/mysql/
-- Datadir =/var/mysql/data/
-- User = mysql
3. add mysql to start up
Chmod + x/etc/init. d/mysqld
Vi/etc/init. d/mysqld (edit this file, find and modify the following variable content :)
Basedir =/usr/local/mysql
Datadir =/var/mysql/data
Chkconfig -- add mysqld
Chkconfig -- level 345 mysqld on
4. start mysql
Service mysqld start
BitsCN.com