CentOS6.5+mysql5.1源码安装过程

一:先安装依赖包(不然配置的时候会报错的!)

yum -y install ncurses* libtermcap* gcc-c++*

新建mysql用户

[[email protected]]# groupadd mysql
[[email protected]]# useradd -g mysql -s /sbin/nologin mysql

二:获取mysql源码包

mysql官网下载源码即可

三:安装mysql

[[email protected] mysql]# tar xvf mysql-5.1.51.tar.gz
[[email protected] mysql]# cd mysql-5.1.51
[[email protected] mysql-5.1.51]# ./configure --prefix=/usr/local/mysql--localstatedir=/usr/local/mysql/data --enable-assembler --enable-local-infile--enable-thread-safe-client --with-big-tables --with-charset=utf8--with-extra-charsets=gbk,gb2312,utf8,ascii --with-readline --with-ssl--with-embedded-server --with-pthread --with-mysqld-user=mysql--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static--with-plugins=partition,innobase,innodb_plugin >/home/mysql_setuplogs_configure.log2>&1
[[email protected] mysql-5.1.51]# make >  /home/mysql_setuplogs_make.log2>&1
[[email protected] mysql-5.1.51]# make install > /home/mysql_setuplogs_makeinstall.log2>&1
[[email protected] local]# chown -R mysql. /usr/local/mysql
[[email protected] local]# echo "exportPATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib" >>/etc/profile
[[email protected] ~]# source /etc/profile
[[email protected] mysql-5.1.51]# cp support-files/my-medium.cnf/etc/my.cnf
[[email protected] mysql-5.1.51]# cp support-files/mysql.server.sh/etc/init.d/mysql
[[email protected]]# chmod +x /etc/init.d/mysql
[[email protected]HE1 bin]# mysql_install_db --user=mysql
[[email protected] bin]# ./mysqld_safe --usermysql &  (可以启动但不能停止)
[[email protected] bin]# mysqladmin -uroot password MANAGER
[[email protected] bin]# mysqladmin -uroot -pMANAGER shutdown
[[email protected] mysql]# cp/usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
[[email protected] init.d]# chmod 700 /etc/init.d/mysql
[[email protected] init.d]# chkconfig --add mysql

提示:configure支持的选项非常多,详细的参数及说明建议参考官方文档,也可以通过./configure --help查看,这里仅列出常用及推荐使用的选项。

  • --prefix=PREFIX:指定程序安装路径;
  • --enable-assembler:使用汇编模式;
  • --enable-local-infile:启用对LOAD DATA LOCAL INFILE语法的支持(默认不支持);
  • --enable-profiling:Build a version with query profiling code (req.community-features)
  • --enable-thread-safe-client:使用编译客户端;
  • --with-big-tables:启用32位平台对4G大表的支持;
  • --with-charset=CHARSET:指定字符集;
  • --with-collation=:默认collation;
  • --with-extra-charsets=CHARSET,CHARSET,...:指定附加的字符集;
  • --with-fast-mutexes:Compile with fast mutexes
  • --with-readline:
  • --with-ssl:启用SSL的支持;
  • --with-server-suffix=:添加字符串到版本信息;
  • --with-embedded-server:编译embedded-server;
  • --with-pthread:强制使用pthread类库;
  • --with-mysqld-user=:指定mysqld守护进程的用户;
  • --with-mysqld-ldflags=:静态编译MySQL服务器端;
  • --with-client-ldflags=:静态编译MySQL客户端;
  • --with-plugins=PLUGIN,PLUGIN,...:MySQL服务器端支持的组件(默认为空),可选值较多:
  • partition:MySQL Partitioning Support;
  • daemon_example:This is an example plugin daemon;
  • ftexample:Simple full-text parser plugin;
  • archive:Archive Storage Engine;
  • blackhole:Basic Write-only Read-never tables;
  • csv:Stores tables in text CSV format,强制安装;
  • example:Example for Storage Engines for developers;
  • federated:Connects to tables on remote MySQL servers;
  • heap:Volatile memory based tables,强制安装;
  • ibmdb2i:IBM DB2 for i Storage Engine;
  • innobase:Transactional Tables using InnoDB;
  • innodb_plugin:Transactional Tables using InnoDB;
  • myisam:Traditional non-transactional MySQL tables,强制安装;
  • myisammrg:Merge multiple MySQL tables into one,强制安装;
  • ndbcluster:High Availability Clustered tables;
  • --with-plugin-PLUGIN:强制指定的插件链接至MySQL服务器;
  • --with-zlib-dir=:向MySQL提供一个自定义的压缩类库地址;
  • --without-server:仅安装MySQL客户端;
  • --without-query-cache:不要编译查询缓存;
  • --without-geometry:不要编译geometry-related部分;
  • --without-debug:编译为产品版,放弃debugging代码;
  • --without-ndb-debug:禁用special ndb debug特性;

提示:执行Configure时如果报bin/rm: cannot remove `libtoolt‘: No such file or directory错误,可按照下列步骤解决:

1、确认libtool是否已经安装,如果没有安装的话,则先安装libtool

# rpm -qa | grep libtool

# yum -y install libtool

2、分别执行以下三条命令:

# autoreconf --force --install

# libtoolize --automake --force

# automake --force --add-missing

再重新编译安装,问题解决!

来自 <http://blog.itpub.net/7607759/viewspace-684612/>

CentOS6.5中编译是遇见如下错误

error: No curses/termcap library found

checking fortgetent in -lncurses... no

checking fortgetent in -lcurses... no

checking fortgetent in -ltermcap... no

checking fortgetent in -ltinfo... no

checking fortermcap functions library... configure: error: No curses/termcap library found

安装之初我已经用yum安装了ncurses*了,不过rpm -qa发现缺少了

ncurses-devel

rpm -ivh 安装即可 ncurses-devel-5.7-3.20090208.el6.x86_64

gcc-c++

[[email protected]]# rpm -qa|grep ncurses

ncurses-base-5.7-3.20090208.el6.x86_64

ncurses-5.7-3.20090208.el6.x86_64

ncurses-devel-5.7-3.20090208.el6.x86_64

ncurses-libs-5.7-3.20090208.el6.x86_64

[[email protected]]# rpm -qa|grep gcc

gcc-4.4.7-4.el6.x86_64

libgcc-4.4.7-4.el6.x86_64

gcc-c++-4.4.7-4.el6.x86_64

时间: 2024-08-25 11:10:46

CentOS6.5+mysql5.1源码安装过程的相关文章

CentOS-6.4-minimal版中源码安装MySQL-5.5.38

/** * CentOS-6.4-minimal版中源码安装MySQL-5.5.38 * ---------------------------------------------------------------------------------------------------------------------- * 三种安装方式 * 1)源码安装 * 2)二进制包安装 * 3)rpm或yum安装 * 本文演示的是源码安装,并且,从mysql-5.5开始,源码安装要通过cmake安装

mysql-5.5.28源码安装过程中错误总结

介绍一下关于mysql-5.5.28源码安装过程中几大错误总结,希望此文章对各位同学有所帮助.系统centOS 6.3 mini (没有任何编译环境)预编译环境首先装了众所周知的 cmake(yum install cmake -y) 复制代码 代码如下: ../bootstrap Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using

linux小白 mysql5.0源码安装配置

安装mysql-5.0.45.tar.gz(该软件包下载地址:http://www.filewatcher.com/m/mysql-5.0.45.tar.gz.24433261-0.html) # groupadd mysql              #添加mysql组 # useradd -g mysql mysql      #添加mysql用户,且加入mysql组 --------------------编译过程---------------------------------- # t

CentOS-6.4-minimal版中源码安装Apache-2.2.29

/** * CentOS-6.4-minimal版中源码安装Apache-2.2.29 * ---------------------------------------------------------------------------------------------------------------------- * 源码安装软件时常见的三个步骤 * 1)配置环境:通常命令为./configure --prefix=DIR(即指定软件安装目录),如果还想启用其它功能,可在后面接着添

Linux中centos中httpd源码安装过程详解

在Linux中软件安装有两大类,一类是软件包安装,一类是源代码安装.软件包安装就是指将编译好的二进制封装成rpm包,可以直接使用rpm工具和yum工具安装.源代码安装是指没有编译成二进制,需要通过手动编译的.使用源代码安装的原因有两个,一个就是想使用最新版的软件,另一类就是想自定义其功能的. 在httpd的源码安装过程中需要用到:APR.APR-UTIL. PCRE.httpd源码安装过程:1.展开压缩文件,把压缩文件解压缩到/usr/local/src.2.在解压文件目录使用 ./config

Linux MySQL5.5源码安装

环境:CentOS7,MySQL5.5 1.MySQL5.5源码下载 Oracle的网站打开较慢,http://mirrors.sohu.com/mysql/这里提供了MySQL的镜像.一般的,Linux的程序安装有两种方式:A利用RPM,YUM等工具 B手动安装.其中手动安装又有两种方式,一种是直接下载已经编译好的二进制文件,另一种是下载源码手动编译.我们这里尝试下载源码手动编译的方式. 如何区分下载文件列表的文件是已编译好的二进制文件,还是源码文件: A.文件大小.由于从源码编译为二进制文件

ubuntu mysql5.7源码安装

最近在学习搭建LNMP环境,nginx相对来说还是比较好搭的,但是mysql就太坑爹了,之前在网上查资料的时候看到一个人说它花了一周的时间源码搭建mysql,刚开始内心还有点嘲笑他,但是此时此刻我发现是我错了,周日花了一天的时间使用源码安装了mysql,累感不爱.在ubuntu下mysql可以使用apt-get命令一步安装,仅做少许配置,但是源码安装真是掉了一层皮,但是源码安装又是一个运维必须要会的一个东西,所以必须学习. 1.下载mysql 这个是最基本的第一步,下载地址http://dev.

MYSQL5.5源码安装 linux下

首先安装必要的库 yum -y install gcc* ###### 安装 MYSQL ######首先安装camke 一.支持YUM,则  yum install -y cmake 二.也可以源码安装 cd /usr/local/src #下载cmake wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz tar zxvf cmake-2.8.7.tar.gz cd cmake-2.8.7 #安装cmake ./configure

记录mysql5.7源码安装流程

今天给别人的linux服务器安装mysql,选择使用源码安装的,在安装的过程中,还是遇到了一些问题,主要是在一下几点:1.cmake的时候,有些参数配置的路径老是报不存或是提示你查看CMakeOutput.log等日志文件.2.mysql 编译和安装完成后,初始化后,启动失败.这个就看mysql错误日子就好了,今天我就老是初始化失败.主要原因是mysql配置文件my.cnf中的basedir.datadir还有日志文件路径的问题,主要体现在权限和文件是否存在的问题. 现在就把主要流程记录下来,方