centos 5.9 安装mysql 5.5.31
来源:互联网 发布:江苏省软件协会 编辑:程序博客网 时间:2024/05/23 13:17
在linux下安装安装mysql,会出现各种各样的依赖关系,在centos下安装mysql出现各种依赖关系
[root@localhost]# tar xzvf cmake-2.8.4.tar.gz
[root@localhost src]# cd cmake-2.8.4
[root@localhost cmake-2.8.4]# ./configure
Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC. See cmake_bootstrap.log for compilers attempted.
报错:缺少C的编译器。
安装gcc编译器
可以从Linux系统的安装盘中安装,也可以简单地用yum安装
[root@localhost ~]# yum install gcc
继续cmake的安装
[root@localhost cmake-2.8.4]# ./configure
C compiler on this system is: cc
Error when bootstrapping CMake: Cannot find appropriate C++ compiler on this system. Please specify one using environment variable CXX. See cmake_bootstrap.log for compilers attempted.
再次报错:缺少C++编译器。
[root@localhost ~]# yum install gcc-c++
重复上面的操作
[root@localhost cmake-2.8.4]# ./configue
[root@localhost cmake-2.8.4]# make
[root@localhost cmake-2.8.4]# make install
开始正式安装Mysql
添加mysql用户和用户组
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -r -g mysql mysql
下载mysql的源码包mysql-5.5.31.tar.gz
[root@localhost ~]# tar xzvf mysql-5.5.31.tar.gz
[root@localhost ~]# cd mysql-5.5.31
cmake运行
[root@localhost mysql-5.5.31]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.8.10.2
-- MySQL 5.5.31
-- Packaging as: mysql-5.5.31-Linux-x86_64
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses library not found. Please install appropriate package,
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:127 (FIND_CURSES)
cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:269 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
缺少Curses包,解决办法:remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
在CentOS下需要安装ncurses-devel
[root@localhost mysql-5.5.31]# yum install ncurses-devel
安装完毕,重新cmake运行
[root@localhost mysql-5.5.31]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
....................................................................
-- Performing Test HAVE_PEERCRED - Success
Warning: Bison executable not found in PATH
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mysql-5.5.31
有一个警告,缺少Bison就安装一下
[root@localhost mysql-5.5.31]# yum install bison
删除CMakeCache.txt,重新cmake。接下来开始编译安装,时间有点稍长,可以干点别的看看财经新闻
[root@localhost mysql-5.5.31]# make && make install
修改目录权限
[root@localhost ~]# cd /usr/local/mysql
[root@localhost mysql]# chown -R root:mysql .
[root@localhost mysql]# chown -R mysql:mysql data
创建系统数据库的表
[root@localhost scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
cp配置文件
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
修改环境变量
[root@localhost ~]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
export PATH
unset USERNAME
如上面类似添加mysql路径
总结 centos 下安装很方便,因为yum已经给安装上了,缺依赖的时候会自动下载安装。
[root@localhost]# tar xzvf cmake-2.8.4.tar.gz
[root@localhost src]# cd cmake-2.8.4
[root@localhost cmake-2.8.4]# ./configure
Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC. See cmake_bootstrap.log for compilers attempted.
报错:缺少C的编译器。
安装gcc编译器
可以从Linux系统的安装盘中安装,也可以简单地用yum安装
[root@localhost ~]# yum install gcc
继续cmake的安装
[root@localhost cmake-2.8.4]# ./configure
C compiler on this system is: cc
Error when bootstrapping CMake: Cannot find appropriate C++ compiler on this system. Please specify one using environment variable CXX. See cmake_bootstrap.log for compilers attempted.
再次报错:缺少C++编译器。
[root@localhost ~]# yum install gcc-c++
重复上面的操作
[root@localhost cmake-2.8.4]# ./configue
[root@localhost cmake-2.8.4]# make
[root@localhost cmake-2.8.4]# make install
开始正式安装Mysql
添加mysql用户和用户组
[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -r -g mysql mysql
下载mysql的源码包mysql-5.5.31.tar.gz
[root@localhost ~]# tar xzvf mysql-5.5.31.tar.gz
[root@localhost ~]# cd mysql-5.5.31
cmake运行
[root@localhost mysql-5.5.31]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.8.10.2
-- MySQL 5.5.31
-- Packaging as: mysql-5.5.31-Linux-x86_64
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses library not found. Please install appropriate package,
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:127 (FIND_CURSES)
cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:269 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
缺少Curses包,解决办法:remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
在CentOS下需要安装ncurses-devel
[root@localhost mysql-5.5.31]# yum install ncurses-devel
安装完毕,重新cmake运行
[root@localhost mysql-5.5.31]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
....................................................................
-- Performing Test HAVE_PEERCRED - Success
Warning: Bison executable not found in PATH
-- Configuring done
-- Generating done
-- Build files have been written to: /root/mysql-5.5.31
有一个警告,缺少Bison就安装一下
[root@localhost mysql-5.5.31]# yum install bison
删除CMakeCache.txt,重新cmake。接下来开始编译安装,时间有点稍长,可以干点别的看看财经新闻
[root@localhost mysql-5.5.31]# make && make install
修改目录权限
[root@localhost ~]# cd /usr/local/mysql
[root@localhost mysql]# chown -R root:mysql .
[root@localhost mysql]# chown -R mysql:mysql data
创建系统数据库的表
[root@localhost scripts]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
cp配置文件
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
修改环境变量
[root@localhost ~]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
export PATH
unset USERNAME
如上面类似添加mysql路径
总结 centos 下安装很方便,因为yum已经给安装上了,缺依赖的时候会自动下载安装。
- centos 5.9 安装mysql 5.5.31
- Centos 6.4 +Mysql 5.5 安装
- centos 6.5 安装 mysql 5.5
- centos 安装mysql 5.5.44
- 安装centos安装mysql
- MYSQL 源码安装(CentOS 5.9)
- CentOS 5.5 编译安装MySQL 5.5
- CentOS下编译安装mysql 5.5.10
- centos下 MySQL 5.5.14 编译安装
- centos源码编译安装mysql-5.5.13
- Centos 6.1源码安装mysql 5.5.21
- CentOS 5.5源码安装apache+mysql+php
- CentOS 源码安装 mysql 5.5.x
- Centos 5.6编译安装mysql 5.5.11
- centos 编译安装 mysql 5.5x
- CentOS 5.5 编译安装Apache+MySQL+PHP
- centos 6.2 安装mysql-5.5.17
- CentOS 5.5(Apache+PHP+Mysql)安装
- 【转】运用autoconf和automake自动生成Makefile实例讲解
- 为sourceinsight添加makefile、kconfig、*.S文件支持
- linux runlevel(启动级别)
- cocos2d-x 菜单CCMenu和CCMenuItemImage应用实例
- didReceiveMemoryWarning:和viewDidUnload:
- centos 5.9 安装mysql 5.5.31
- 申请Google Map Android API Key-转载只为学习
- 杭电1075
- exp 备份数据
- 去掉CodeIgniter URL中的index.php
- 动态查找之二叉排序树(BST)
- 使用VS2010时遇到的一些小问题的解决方案(从各处搜罗总结的,不定期更新,向原作者致敬)
- JAVA 继承基本类、抽象类、接口
- ubuntu 10.04安装sun-java5-jdk