centos编译安装mysql5.5.9
By admin
- One minute read - 76 words环境: centos 5.5 x86_64 mysqll5.5.9
安装开发工具
yum groupinstall “Development Tools”
安装依赖包
yum install ncurses-devel
编译安装cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz tar xvzf cmake-2.8.4.tar.gz ./configure make make install
下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.9.tar.gz/from/http://mysql.mirror.tw/
编译安装mysql
cd mysql5.5.9 rm CMakeCache.txt cmake .
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5.9/
-DMYSQL_DATADIR=/usr/local/mysql5.5.9/data
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DMYSQL_TCP_PORT=3306
-DMYSQL_UNIX_ADDR=/usr/local/mysql5.5.9/data/mysql.sock
-DMYSQL_USER=mysql
-DWITH_DEBUG=0make && make install
完成后进入MYSQL安装目录
cd /usr/local/mysql5.5.9 cp support-files/my-huge.cnf /etc/my.cnf vi /etc/my.cnf
将数据目录和套接字文件修改为实际值.
修改权限
chown mysql:mysql /etc/my.cnf chown -R mysql:mysql /usr/local/mysql5.5.9
切换用户进入安装目录
su – mysql cd /usr/local/mysql5.5.9 cp scripts/mysql_install_db ./ mysql_install_db
启动MYSQL
bin/mysqld_safe &
完成!