mysql-5.1.68-linux源码安装

今天测试了一下mysql-5.1.68源码安装,具体步骤如下:[@more@]
tar.gz 结尾的 , 解压之后的目录中:
Build 目录:各种平台的编译脚本,监测 cpu 型号的编译脚本
Check-cpu 脚本
Client : 客户端程序的源代码 , mysql.cc,mysqladmin.cc
Docs:
Storage : 存储引擎目录,实现了 hander
Mysys: :mysql 为了实现跨平台对系统库封装
Sql: 数据库主程序目录,存储引擎接口。
Vio: 封装了各种协议的网络操作
Limysqld mysql 链接库的源代码
源码安装中 configure 的作用 , 有检查 c 的编译器,生产 makefile 文件
Configure 的常用选项:
--prefix 设定安装路径,默认为 /user/local
--datadir 设定 mysql 数据文件存放路径
--with-charset 设定系统的默认字符集
--with-collation 设定系统默认的校验规则
--with-extra-charsets 除了默认字符集之外需要编译安装的字符集
--with-unix-socket-path 设定 socket 文件地址
--with-tcp-port 指定监听端口,默认为 3306
--with-mysqld-user 指定运行 mysqld os 用户,默认为 mysql
--without-query-cache 警用 innodb 存储引擎
--with-partition 5.1 版本中开启 partition 支持特性
--enable-thread-safe-client 以线程方式编译客户端
--with-pthread 强制使用 pthread 线程库编译
--without-debug 使用非 debug 模式
--with-named-thread-libs 指定使用某个特定的线程库编译
--with-mysqld-ldflags mysqld 的额外 link 参数
--with-client-ldflags client 的额外 link 参数
开始安装
[root@oracle mysql-5.1.68]# groupadd mysql
[root@oracle mysql-5.1.68]# useradd -g mysql mysql
[root@oracle u02]# tar -zxvf mysql-5.1.68.tar.gz
[root@oracle mysql-5.1.68]# mkdir mysql5168
[root@oracle mysql-5.1.68]# ./configure --prefix=/u02/mysql5168/ --without-debug --enable-thread-safe-client --enable-assembler --enable-profiling --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-charsets=latin1 --with-extra-charsets=utf8,gbk --with-mysqld-user=mysql --without-embedded-server --with-server-suffix=bruce --with-plugins=innobase,partition
[root@oracle mysql5168]# make
[root@oracle mysql5168]# make install
[root@oracle mysql5168 ]# mkdir data
[root@oracle mysql5168 ]# chown -R mysql:mysql data/
[root@oracle mysql-5.1.68]# pwd
/u02/mysql-5.1.68
[root@oracle mysql-5.1.68]# cp support-files/my-small.cnf /u02/my.cnf
/u02/my.conf 中加入如下内容,在 mysqld 标签下 :
basedir=/u02/mysql5168
datadir=/u02/mysql5168/data
[root@oracle mysql5168]# pwd
/u02/mysql5168
[root@oracle mysql5168]# ./bin/mysql_install_db --defaults-file=/u02/my.cnf --user=mysql
mysql> select version();
+-------------+
| version() |
+-------------+
| 5.1.68bruce | 出现的后缀名和 --with-server-suffix=bruce 一样
+-------------+
1 row in set (0.00 sec)
启动 mysql 数据库服务
[root@oracle bin]# pwd
/u02/mysql5168/bin
[root@oracle bin]# ./mysqld_safe --user=mysql &

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24237320/viewspace-1060238/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24237320/viewspace-1060238/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值