首页 > 数据库 > MySQL > 正文

Centos5.5中安装Mysql5.5过程、分享

2019-11-02 14:30:57
字体:
来源:转载
供稿:网友

这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅

Mysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。

安装cmake

 

代码如下:
[[email protected] ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
[[email protected] ~]# tar xvf cmake-2.8.12.2.tar.gz
[[email protected] ~]# cd cmake-2.8.12.2
[[email protected] cmake-2.8.12.2]#./bootstrap
[[email protected] cmake-2.8.12.2]# make
[[email protected] cmake-2.8.12.2]# make install

 

安装mysql

 

代码如下:
[[email protected] ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz
[[email protected] ~]# tar xvf mysql-5.5.37.tar.gz
[[email protected] ~]# cd mysql-5.5.37
[[email protected] mysql-5.5.37]# cmake ./

 

可能还会报这个错,没有就跳过

 

代码如下:
CMake Error at cmake/readline.cmake:83(MESSAGE):
Curses library not found.  Pleaseinstall appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name islibncurses5-dev, on Redhat and derivates it
五个字网名[www.la240.com/html2017/1/10/]
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:355 (MYSQL_CHECK_READLINE
-- Configuring incomplete, errors occurred!
See also "/root/my/mysql-5.5.37/CMakeFiles/CMakeOutput.log".
See also"/root/my/mysql-5.5.37/CMakeFiles/CMakeError.log".

 

说明centos系统没有ncurses-devel

 

代码如下:
[[email protected] ~]# wget http://invisible-island.net/datafiles/release/ncurses.tar.gz
[[email protected] ~]# cd ncurses-5.9
[[email protected] ncurses-5.9]#./configure
[[email protected] ncurses-5.9]# make
[[email protected] ncurses-5.9]# make install

 

再删除刚才编译生成的 CMakeCache.txt 文件,否则无法进行下一步

 

代码如下:
[[email protected] mysql-5.5.37]# rm -f CMakeCache.txt

 

继续编译mysql

 

代码如下:
[[email protected] ~]# cmake ./
[[email protected] ~]# make
[[email protected] ~]# make install

 

这样,mysql默认将成功安装到/usr/local/mysql

创建mysql用户组

 

代码如下:
[[email protected] ~]# groupadd mysql
[[email protected] ~]# useradd –r –g mysql mysql
[[email protected] ~]# chown –R mysql.mysql /usr/local/mysql

 

启动mysql

 

代码如下:
[[email protected] ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql  
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表