一、安装前这边
1、mysql 5.5以上的版本需要cmake编译安装,所以需要先安装cmake:
yum -y install cmake
2、安装
tar -zxvf mysql-5.5.15.tar.gz
cd mysql-5.5.15
cmake -DCMAKE_INSTALL_PREFIX:PATH=/data/mysql -DMYSQL_DATADIR=/data/db -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
PS:cmake的时候如果报错:
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:118 (FIND_CURSES)
cmake/readline.cmake:214 (MYSQL_USE_BUNDLED_READLINE)
CMakeLists.txt:268 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
请安装:yum install ncurses-devel