mysql5.5已经改用cmake编译,编译前请安装cmake;
yum install cmake -y
或者自行下载:
-------------------------------
wget
tar -xvf mysql-5.5.22.tar.gz -C /usr/local/src
groupadd mysql
useradd -r -g mysql mysql
cd /usr/local/src/mysql-5.5.22/
cmake .
make
make install
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
cp support-files/my-medium.cnf /etc/my.cnf
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server
==========================
如果要更改mysql编译配置:
make clean
rm -f CMakeCache.txt
重新编译即可
若遇到如下错误提示:
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
解决:yum install gcc-c++ -y
===========================
mysql的data目录是在/usr/local/mysql/data,你可以移到/data下:
mv /usr/local/mysql/data /
vi /etc/my.cnf的[mysqld]中加入:
datadir = /data
阅读(8066) | 评论(1) | 转发(1) |