需要下载安装Cmake;
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
安装cmake;
yum install gcc*
tar xvzf cmake-2.8.4.tar.gz
./configure
make
make install
下载mysql:wget http://downloads.skysql.com/archives/mysql-5.5/mysql-5.5.9.tar.gz
tar zxvf mysql-5.5.9.tar.gz
cd mysql-5.5.9
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \
-DMYSQL_DATADIR=/var/mysql\
-DMYSQL_UNIX_ADDR=/var/mysql/mysqld.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DENABLED_LOCAL_INFILE=1\
-DMYSQL_TCP_PORT=3306\
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8-general_ci \
-DMYSQL_UNIX_ADDR=/var/mysql/mysql.sock \
-DWITH_DEBUG=0
报错:
解决:yum install ncurses*
rm CMakeCache.txt
再执行上面命令
cmake . \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ \
-DMYSQL_DATADIR=/var/mysql\
-DMYSQL_UNIX_ADDR=/var/mysql/mysqld.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DENABLED_LOCAL_INFILE=1\
-DMYSQL_TCP_PORT=3306\
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8-general_ci \
-DMYSQL_UNIX_ADDR=/var/mysql/mysql.sock \
-DWITH_DEBUG=0
复制配置文件
cp support-files/my-huge.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
修改配置文件my.cnf
在[mysqld]下添加 :datadir = /usr/local/mysql/data/
没添加的话数据库无法启动
service mysqld start
设置密码:mysqladmin -uroot password "yourpassword"