本次试验环境和以往有些区别,这次用的是centos6.0的系统,安装的mysql是5.5版本的,5.0以上的版本和以前的4.0的有很大区别,第一次安装起来颇费手脚!
先安装这些包,解决依赖关系! 首先需要安装cmake [root@ceshi6 ~]# tar -zxvf cmake-2.8.7.tar.gz [root@ceshi6 ]# cd cmake-2.8.7 [root@ceshi6 cmake-2.8.7]# ./configure [root@ceshi6 cmake-2.8.7]# make && make install 好了,现在开始正是安装mysql5.5版本 [root@ceshi6 ~]# tar -zxvf mysql-5.5.27.tar.gz [root@ceshi6 ~]# cd mysql-5.5.27
[root@ceshi6 mysql-5.5.27]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ //指定mysql安装目录 [root@ceshi6 mysql-5.5.27]# make && make install [root@ceshi6 mysql-5.5.27]# chmod +w /usr/local/mysql/ [root@ceshi6 mysql-5.5.27]# chown -R mysql:mysql /usr/local/mysql/ [root@ceshi6 mysql-5.5.27]# ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so18 [root@ceshi6 mysql-5.5.27]# mkdir -p /data/mysql/data/ [root@ceshi6 mysql-5.5.27]# mkdir -p /data/mysql/log/ [root@ceshi6 mysql-5.5.27]# chown -R mysql:mysql /data/mysql/ mysql配置文件
[root@ceshi6 support-files]# cp my-large.cnf /etc/my.cnf 初始化mysql
[root@ceshi6 support-files]# /usr/local/mysql/scripts/mysql_install_db \ [root@ceshi6 support-files]# vi /etc/init.d/mysqld
basedir=/usr/local/mysql [root@ceshi6 support-files]# chkconfig mysql on [root@ceshi6 mysql-5.5.27]# mysql -u root -p 一切OK,大功告成!
安装过程其实没有这么顺利,在安装过程中主要的几个报错及解决方法被我记录下来了。 报错(一) 编译cmake的时候提示以下错误
[root@ceshi6 cmake-2.8.7]# ./configure 安装make,问题解决! [root@ceshi6 cmake-2.8.7]# yum install make 报错(二) 编译安装mysql的时候提示下列错误
[root@ceshi6 mysql-5.5.27]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
CMake Error at cmake/readline.cmake:83 (MESSAGE):
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
安装依赖包就解决了! [root@ceshi6 mysql-5.5.27]# yum install automake* zlib* libxml* ncurses-devel* libmcrypt* libtool* 报错(三) 编译mysql的时候提示下列报错: remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-d
解决方法:
(责任编辑:IT) |