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

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:启用对LOADDATALOCALINFILE语法的支持(默认不支持)

  • --enable-profiling:Buildaversionwithqueryprofilingcode(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:Compilewithfastmutexes

  • --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:MySQLPartitioningSupport

  • daemon_example:Thisisanexampleplugindaemon

  • ftexample:Simplefull-textparserplugin

  • archive:ArchiveStorageEngine

  • blackhole:BasicWrite-onlyRead-nevertables

  • csv:StorestablesintextCSVformat,强制安装;

  • example:ExampleforStorageEnginesfordevelopers

  • federated:ConnectstotablesonremoteMySQLservers

  • heap:Volatilememorybasedtables,强制安装;

  • ibmdb2i:IBMDB2foriStorageEngine

  • innobase:TransactionalTablesusingInnoDB

  • innodb_plugin:TransactionalTablesusingInnoDB

  • myisam:Traditionalnon-transactionalMySQLtables,强制安装;

  • myisammrg:MergemultipleMySQLtablesintoone,强制安装;

  • ndbcluster:HighAvailabilityClusteredtables

  • --with-plugin-PLUGIN:强制指定的插件链接至MySQL服务器;

  • --with-zlib-dir=:向MySQL提供一个自定义的压缩类库地址;

  • --without-server:仅安装MySQL客户端;

  • --without-query-cache:不要编译查询缓存;

  • --without-geometry:不要编译geometry-related部分;

  • --without-debug:编译为产品版,放弃debugging代码;

  • --without-ndb-debug:禁用specialndbdebug特性;

提示:执行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

转载于:https://www.cnblogs.com/suifu/p/5823092.html

CentOS6.5+mysql5.1源码安装过程相关推荐

  1. mysql5.7.21源码解析,史上最强Mysql5.7源码安装讲解

    今天给小伙伴们介绍一下Mysql5.7源码安装,在安装过程中还是碰到了一些问题,下面介绍安装步骤时,会告诉大家问题在哪儿,怎么解决的,废话不多说,下面就可以说说安装全过程 1.创建用户 groupad ...

  2. linux运行软件代码,Linux软件安装-详细源码安装过程

    1.简介 软件的安装是linux学习时的重中之重,*nux上重要思维哲 学组合若干小功能进而成为一个可用可维护的系统平台.那么在 操作系统构建完成之时,除非内核等支持系统必需软件之外,可 拓展可维护的 ...

  3. scylladb源码安装过程

    1.安装ubuntu http://mirrors.163.com/ubuntu-releases/18.04.4/ 使用以上的国内地址下载镜像速度更快,使用的ubuntu版本是ubuntu-18.0 ...

  4. mysql 5.6.23 源码包安装报错_大环境下MySQL5.6源码安装实战一步步教你 CentOS6.5_64bit下编译安装...

    一.关闭防火墙 chkconfig iptables off service iptables stop 二.检查操作系统上是否安装了MySQL [[email protected] backup]# ...

  5. Linux+Apache2.4+PHP5.6+MySQL5.6源码安装步骤

    一.安装Apache 若要安装apache服务器软件,需要安装以下几个依赖软件 apr-1.4.6.tar.gz 下载地址:http://apr.apache.org/ apr-util-1.4.1. ...

  6. mysql5.7源码安装 简书_在CentOS7上编译安装MySQL 5.7.13步骤详解

    MySQL 5.7主要特性 更好的性能 对于多核CPU.固态硬盘.锁有着更好的优化,每秒100W QPS已不再是MySQL的追求,下个版本能否上200W QPS才是用户更关心的. 更好的InnoDB存 ...

  7. snort-2.9.7.0源码安装过程

    2015/02/15,centos6.5-64-minimal,初始205个包 [root@localhost snort]# yum install wget [root@localhost sno ...

  8. mysql5.5源码安装_MySQL5.5源码安装

    1.创建运行用户 useradd -M -s /sbin/nologin mysql //新建程序用户并加入mysql组,不允许登陆系统 2.解包 cd //切换到当前用户家目录 tar -zxvf ...

  9. mysql5.7 源码安装

    1.卸载系统自带mysql [root@localhost ~]# rpm -qa | grep mysql[root@localhost ~]# rpm -qa | grep mariadbmari ...

最新文章

  1. Linux下文件的三种时间戳
  2. ASP.NET 2.0 X64的奇怪问题
  3. 使用podspec创建iOS插件
  4. 记一次T-SQL查询优化 索引的重要性
  5. samba   服务
  6. core java面试题_CoreJava基础面试题
  7. java设置并行度_控制Java并行流的并行度
  8. 前端学习(2758):view基本使用
  9. 数据库(4)表的基本操作
  10. C语言编程计算y,C语言编程入门之--第五章C语言基本运算和表达式-part4
  11. python冒泡排序_python实现基本算法之冒泡排序(Bubble Sort)
  12. DIVX、AVC、HEVC格式的区别
  13. 《数据库原理MySQL》第三次上机实验
  14. 2019数据安装勾选_Origin2019下载和安装教程
  15. 当中国传统文化IP与NFT撞个满怀,能擦出什么火花
  16. 思科模拟器交换机配置secret和password
  17. 一篇文章让你认识什么是saas模式
  18. 结识51CTO学院后【51CTO学院三周年】
  19. vue 视频 时间进度条组件
  20. 逻辑综合重点解析(Design Compiler篇)

热门文章

  1. 2018-10-05学习笔记
  2. 基于表格存储的高性能监控数据存储计算方案
  3. .NET中常见的内存泄露问题——GC、委托事件和弱引用
  4. VIM使用系列:quickfix功能
  5. Sql Function defference returns and returns
  6. 【讨论】js对数组去重复值
  7. eclipse进行远程调试教程,轻松搞定生产环境问题
  8. learn go function callback
  9. Java继承中成员变量和成员函数的覆盖
  10. Manacher算法 - 求最长回文串的利器