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

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

新建mysql用户

[root@HE1Packages]# groupadd mysql
[root@HE1Packages]# useradd -g mysql -s /sbin/nologin mysql

二:获取mysql源码包

mysql官网下载源码即可

三:安装mysql

[root@HE1 mysql]# tar xvf mysql-5.1.51.tar.gz
[root@HE1 mysql]# cd mysql-5.1.51
[root@HE1 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
[root@HE1 mysql-5.1.51]# make >  /home/mysql_setuplogs_make.log2>&1
[root@HE1 mysql-5.1.51]# make install > /home/mysql_setuplogs_makeinstall.log2>&1
[root@HE1 local]# chown -R mysql. /usr/local/mysql
[root@HE1 local]# echo "exportPATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib" >>/etc/profile
[root@HE1 ~]# source /etc/profile
[root@HE1 mysql-5.1.51]# cp support-files/my-medium.cnf/etc/my.cnf
[root@HE1 mysql-5.1.51]# cp support-files/mysql.server.sh/etc/init.d/mysql
[root@HE1mysql-5.1.51]# chmod +x /etc/init.d/mysql
[root@HE1 bin]# mysql_install_db --user=mysql
[root@HE1 bin]# ./mysqld_safe --usermysql &  (可以启动但不能停止)
[root@HE1 bin]# mysqladmin -uroot password MANAGER
[root@HE1 bin]# mysqladmin -uroot -pMANAGER shutdown
[root@HE1 mysql]# cp/usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
[root@HE1 init.d]# chmod 700 /etc/init.d/mysql
[root@HE1 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++

[root@HE1init.d]# 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

[root@HE1init.d]# 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

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

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

    数据库安装 1新增mysql用户 [root@HE1mysql]# groupadd mysql -g 502 [root@HE1mysql]# useradd -g mysql -s /sbin/n ...

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

    介绍一下关于mysql-5.5.28源码安装过程中几大错误总结,希望此文章对各位同学有所帮助.系统centOS 6.3 mini (没有任何编译环境)预编译环境首先装了众所周知的 cmake(yum ...

  3. mysql5.6源码安装(转)

    mysql5.6源码安装 转自 jabbok博客园 https://www.cnblogs.com/jabbok/p/9418344.html 1 编译安装 1 2 3 4 5 6 groupadd ...

  4. Linux MySQL5.5源码安装

    环境:CentOS7,MySQL5.5 1.MySQL5.5源码下载 Oracle的网站打开较慢,http://mirrors.sohu.com/mysql/这里提供了MySQL的镜像.一般的,Lin ...

  5. ubuntu mysql5.7源码安装

    本系列的lnmp的大框架基本上是按照http://www.linuxzen.com/lnmphuan-jing-da-jian-wan-quan-shou-ce-si-lnmpda-jian-yuan ...

  6. Mysql5.5源码安装步骤笔记记录

    1.cmake软件的安装wget https://cmake.org/files/v3.5/cmake-3.5.0-rc3.tar.gztar xf cmake-3.5.0.tar.gzcd cmak ...

  7. Linux系统源码安装过程中的prefix选项

    在linux和unix环境中,源码安装是最常用的软件安装方式,一些软件除了提供源码外,也提供各种发行版的二进制安装包(如基于redhat包管理工具的rpm包),但强烈建议使用源码安装方式.原因是:(1 ...

  8. MYSQL5.5源码安装 linux下

    /* 首先安装必要的库 */ yum -y install gcc* ###### 安装 MYSQL ###### 首先安装camke 一.支持YUM,则 yum install -y cmake 二 ...

  9. gdb源码安装过程中的问题:no termcap library found

    gdb使用源码安装的时候遇到错误:no termcap library found ./configure -->  make --> make install 解决办法,下载termca ...

随机推荐

  1. iptables-过滤61开头的ip数据包

    iptables -F root@android:/system/bin # iptables -L -n iptables -L -n Chain INPUT (policy ACCEPT) tar ...

  2. IDEA github的应用

    1.下载并安装一个git 一直点下一步就可以 2.去github官网注册一个账号 https://github.com/ 2.1点击Sign up 进入注册页面 2.2填写注册信息,点击Create ...

  3. codeforces 492E. Vanya and Field(exgcd求逆元)

    题目链接:codeforces 492e vanya and field 留个扩展gcd求逆元的板子. 设i,j为每颗苹果树的位置,因为gcd(n,dx) = 1,gcd(n,dy) = 1,所以当走 ...

  4. php自学笔记3

    -------补充--------建议定义常量时,判断常量名是否被定义,用defined()判断,返回布尔型if(!defined("POEM")){//没定义过 define(& ...

  5. ruby, gem install 出现网络错误

    gem sources #查看目前的源 gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.or ...

  6. poj3190区间类贪心+优先队列

    题意:每个奶牛产奶的时间为A到B,每个奶牛产奶时要占用一间房子,问n头奶牛产奶共需要多少房子,并输出每头奶牛用哪间房子 分析:这题就是一个裸的贪心,将奶牛按开始时间进行排序即可,但考虑一下数据范围,我 ...

  7. Android源码编译jar包BUILD_JAVA_LIBRARY 与BUILD_STATIC_JAVA_LIBRARY的区别(三)

    继续, 上文提到的是用BUILD_STATIC_JAVA_LIBRARY在Android4.2源码下编译出来的jar包可以在Eclipse(SDK版本4.1)上使用, 找来Android6.0的源码, ...

  8. ios 简单的plist文件读写操作(Document和NSUserDefaults)

    最近遇到ios上文件读写操作的有关知识,记录下来,以便以后查阅,同时分享与大家. 一,简单介绍一下常用的plist文件. 全名是:Property List,属性列表文件,它是一种用来存储串行化后的对 ...

  9. UIAlertController高级之嵌入其他控件

    在编码过程中,我们经常遇到需要这样一个效果,就是弹出框的嵌套; 举个最简单的例子,比如你要选择时间,必然需要一个时间选择器DatePicker.但是这个选择器又是在你点击某按钮时弹出,弹出方式最常见的 ...

  10. WINDOWS下搭建SVN服务器端的步骤分享(Subversion)

    1.获取svn程序 2.安装 Subversion(以下简称SVN)的服务器端和客户端.下载下来的服务器端是个 zip压缩包,直接解压缩即可,比如我解压到 E:\subversion .客户端安装文件 ...