1. 源代码包下载 

源代码包通常也採用tar.gz压缩。名称中仅仅包括版本号信息,大小也比RPM包、二进制包小非常多,解压后的文件里含有INSTALL-SOURCE文件。可从MySQL官网(http://www.mysql.com/downloads/)下载,如:mysql-5.5.17.tar.gz

2. CMake

在採用源代码包安装MySQL实例之前,先来介绍一下cmake这个编译工具。

在MySQL 5.5之前。是採用configure工具运行源代码编译的,到了MySQL 5.5,改用cmake进行编译。这是一个比make更高级的编译配置工具。可依据不同平台、不同编译器。生产对应的Makefile或者vcproj项目,所以须要首先从官网(http://www.cmake.org)下载cmake工具并安装之。

安装cmake之前安装gcc包

rpm -ivh kernel-headers-2.6.18-308.el5.x86_64.rpm

rpm -ivh glibc-headers-2.5-81.x86_64.rpm

rpm -ivh glibc-devel-2.5-81.x86_64.rpm

rpm -ivh gcc-4.1.2-52.el5.x86_64.rpm

rpm -ivh libstdc++-devel-4.1.2-52.el5.x86_64.rpm

rpm -ivh gcc-c++-4.1.2-52.el5.x86_64.rpm

安装cmake

/mysql/cmake-2.8.3

./configure

gmake && make install

 

 

3. 安装mysql 5.5.17

1. 创建mysql系统组及用户

 groupadd mysql

 useradd –g mysql mysql

 

2. 设置用户操作系统资源限制

 

vi /etc/security/limits.conf

        mysql    soft    nproc    2047

        mysql    hard    nproc    16384

        mysql    soft    nofile    1024

        mysql    hard    nofile    65536

安装须要包

# rpm -ivh ncurses-devel-5.5-24.20060715.x86_64.rpm

# rpm -ivh bison-2.3-2.1.x86_64.rpm

 

 

3. 安装MYSQL Server

#mkdir /opt/mysql

#chown -R mysql:mysql /opt/mysql

#gunzip mysql-5.5.17.tar.gz

#tar xvf mysql-5.5.17.tar

#cd mysql-5.5.17

        # cmake  -DCMAKE_INSTALL_PREFIX=/opt/mysql \

        > -DMYSQL_USER=mysql \

        > -DMYSQL_TCP_PORT=3306 \

        > -DMYSQL_DATADIR=/opt/mysql/data \

        > -DWITH_MYISAM_STORAGE_ENGINE=1 \

        > -DWITH_INNOBASE_STORAGE_ENGINE=1 \

        > -DWITH_ARCHIVE_STORAGE_ENGINE=1 \

        > -DWITH_MEMORY_STORAGE_ENGINE=1 \

        > -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \

        > -DWITH_PARTITION_STORAGE_ENGINE=1 \

        > -DENABLED_LOCAL_INFILE=1 \

        > -DWITH_READLINE=1 \

        > -DWITH_SSL=yes \

        > -DDEFAULT_CHARSET=utf8 \

        > -DDEFAULT_COLLATION=utf8_general_ci \

        > -DEXTRA_CHARSETS=all

         

        #make

        #make install

         

        初始化DB

        # sh scripts/mysql_install_db --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/data

        Installing MySQL system tables...

        OK

        Filling help tables...

        OK

         

        To start mysqld at boot time you have to copy

        support-files/mysql.server to the right place for your system

         

        PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

        To do so, start the server, then issue the following commands:

         

        /opt/mysql/bin/mysqladmin -u root password 'new-password'

        /opt/mysql/bin/mysqladmin -u root -h mysql password 'new-password'

         

        Alternatively you can run:

        /opt/mysql/bin/mysql_secure_installation

         

        which will also give you the option of removing the test

        databases and anonymous user created by default.  This is

        strongly recommended for production servers.

         

        See the manual for more instructions.

         

        You can start the MySQL daemon with:

        cd /opt/mysql ; /opt/mysql/bin/mysqld_safe &

         

        You can test the MySQL daemon with mysql-test-run.pl

        cd /opt/mysql/mysql-test ; perl mysql-test-run.pl

         

        Please report any problems with the /opt/mysql/scripts/mysqlbug script!

 

 

 

4. 启动Mysql Sever

配置service服务

# cp /opt/mysql/files/mysql.server  /etc/init.d/mysql   --配置basedir、datadir

配置mysql參数文件my.cnf

 

 

#vi /etc/my.cnf

[client]

#password       = your_password

port            = 3306

socket          = /opt/mysql/data/mysql.sock

 

[mysqld]

port            = 3306

server-id       = 24

datadir         = /opt/mysql/data

socket          = /opt/mysql/data/mysql.sock

pid-file        = /opt/mysql/data/mysql.pid

character-set-server   = utf8

default_storage_engine = InnoDB

log-bin          = /opt/mysql/data/mysql-bin

binlog_format    = row

sync-binlog      = 1

slow-query-log      = on

slow-query-log-file = /opt/mysql/data/mysql-slow.log

log_error        = /opt/mysql/data/mysql.err

max_connections         = 2000

back_log                = 50

skip-external-locking

skip-name-resolve

 

key_buffer_size         = 256M

max_allowed_packet      = 1M

table_open_cache        = 2000

sort_buffer_size        = 1M

read_buffer_size        = 1M

read_rnd_buffer_size    = 4M

myisam_sort_buffer_size = 64M

thread_cache_size       = 8

query_cache_size        = 16M

thread_concurrency      = 8

 

innodb_data_home_dir      = /opt/mysql/data

innodb_data_file_path     = ibdata1:10M:autoextend

innodb_log_group_home_dir = /opt/mysql/data

innodb_buffer_pool_size         = 256M

innodb_additional_mem_pool_size = 20M

innodb_log_file_size            = 64M

innodb_log_buffer_size          = 8M

innodb_flush_log_at_trx_commit  = 1

innodb_lock_wait_timeout        = 50

 

[mysqldump]

quick

max_allowed_packet = 16M

 

[mysql]

no-auto-rehash

#safe-updates

 

[myisamchk]

key_buffer_size = 128M

sort_buffer_size = 128M

read_buffer = 2M

write_buffer = 2M

 

[mysqlhotcopy]

interactive-timeout

 

"/etc/my.cnf" [New] 62L, 1531C written

[root@mysql support-files]# more /etc/my.cnf 

[client]

#password       = your_password

port            = 3306

socket          = /opt/data/mysql.sock

 

[mysqld]

port            = 3306 

server-id       = 24

datadir         = /opt/mysql/data

socket          = /opt/mysql/data/mysql.sock

pid-file        = /opt/mysql/data/mysql.pid

character-set-server   = utf8

default_storage_engine = InnoDB

log-bin          = /opt/mysql/data/mysql-bin

binlog_format    = row

sync-binlog      = 1 

slow-query-log      = on

slow-query-log-file = /opt/mysql/data/mysql-slow.log

log_error        = /opt/mysql/data/mysql.err

max_connections         = 2000

back_log                = 50

skip-external-locking

skip-name-resolve

 

key_buffer_size         = 256M

max_allowed_packet      = 1M

table_open_cache        = 2000

sort_buffer_size        = 1M

read_buffer_size        = 1M

read_rnd_buffer_size    = 4M

myisam_sort_buffer_size = 64M

thread_cache_size       = 8

query_cache_size        = 16M

thread_concurrency      = 8 

 

innodb_data_home_dir      = /opt/mysql/data

innodb_data_file_path     = ibdata1:10M:autoextend

innodb_log_group_home_dir = /opt/mysql/data

innodb_buffer_pool_size         = 256M

innodb_additional_mem_pool_size = 20M

innodb_log_file_size            = 64M

innodb_log_buffer_size          = 8M

innodb_flush_log_at_trx_commit  = 1

innodb_lock_wait_timeout        = 50

 

[mysqldump]

quick

max_allowed_packet = 16M

 

[mysql]

no-auto-rehash

#safe-updates

 

[myisamchk]

key_buffer_size = 128M

sort_buffer_size = 128M

read_buffer = 2M

write_buffer = 2M

 

[mysqlhotcopy]

interactive-timeout

 

 

# service mysql start

Starting MySQL....[  OK  ]

mysql5.5.17源代码安装的更多相关文章

  1. mysql-5.7.17.msi安装

    mysql-5.7.17.msi安装,跟着截图摩擦,一步一步是爪牙,是魔鬼的步伐 开始: 可以创建其他用户 我自己改了日志名

  2. mysql-5.6.17编译安装和常见问题

    mysql-5.6.17编译安装和常见问题 以前用的是MySQL的5.1版本,且使用的是免编译的包,安装简单.最近换了5.6版本的MySQL,安装过程出现了不少问题. 1. 卸载原来版本的MySQL ...

  3. 超详MySQL5.7.17压缩包安装图文教程

    靠吹风机暖手写完这篇教程...网络上关于MySQL 5.7.17的安装教程很少且不详细,所以总结了这样一篇文章,希望能帮到大家:(相较于Oracle的安装,MySQL还是简单得多) 1. 下载网址:h ...

  4. Mysql5.6.22源代码安装

    二:安装MySQL 安装编译代码需要的包 yum -y install make gcc-c++ cmake bison-devel ncurses-devel 下载MySQL 5.6.14 wget ...

  5. mysql5.7.17源码安装

    创建用户和目录 groupadd mysql useradd -r -g mysql mysql mkdir -p /data/mysql/standby/data mkdir -p /data/my ...

  6. centos编译安装php5.6.20+nginx1.8.1+mysql5.6.17

    LNMP 代表的就是:Linux系统下Nginx+MySQL+PHP这样的站点服务器架构. 本次实践需求: 实践centos6.5编译安装 LNMP生产环境 架构 web生产环境 使用 xcache ...

  7. linux下安装mysql5.7.17及简单配置

    原文:http://www.th7.cn/db/mysql/201612/218745.shtml 1.mysql5.7.17安装在/usr/local/mysql目录里面,也可以安装在其他地方 (安 ...

  8. centos6.7编译安装mysql5.7.17

    centos6.7编译安装mysql5.7.17 2017-03-24 09:57:15 提示:mysql5.7.17和之前5.56以前的版本安装不一样,需要用cmake 另外,看本文档的mysql编 ...

  9. Linux安装mysql-5.7.17

    一.检查系统是否有自带安装MySQL 1.检查 [root@centos ~]# rpm -qa | grep -i mysql mysql-libs-5.1.71-1.el6.x86_64 2.卸载 ...

随机推荐

  1. SQL批量信息保存(XML格式字符串数据)

    /* *功能:SQL批量信息录入 *此存储过程获取表单信息,插入表中.*/CREATE  PROC [dbo].[sp_SaveToMX1]@XML text   --明细表XML字符串信息ASBEG ...

  2. 关于JPush使用CPU占有率100%的情况

    跑模拟器cpu占有率120%+,开始没注意,真机时候手机发烫的厉害,看了下CPU和线程 如图,发现占有率最高的是com.apple.CFSocket.private和org.hxhg.jpush.th ...

  3. Linux2.6的所有内核版本

    Index of /pub/linux/kernel/v2.6 Name Last modified Size Parent Directory - incr/ 03-Aug-2011 20:47 - ...

  4. 加入BOINC(伯克利开放式网络计算平台)

    转载:BOINC:为科学而计算 通过 BOINC 你可以将闲置的计算机时间贡献给 SETI@home, Climateprediction.net, Rosetta@home, World Commu ...

  5. KNN(k-nearest-neighbor)算法

    一.算法概述 该方法的思路是:如果一个样本在特征空间中的k个最相似(即特征空间中最邻近)的样本中的大多数属于某一个类别,则该样本也属于这个类别.KNN算法中, 所选择的邻居都是已经正确分类的对象(训练 ...

  6. Qt信号槽中槽函数为虚函数的一些感想

    有时候,在写connect的时候会去犹豫一个问题----我的槽函数到底需不需要为虚函数.这个问题在我每次写connect的时候我都会反问自己,因为确实,如果你不去深究里面的moc,你发现不了太多问题. ...

  7. JQUERY1.9学习笔记 之基本过滤器(八) 最后元素选择器

    最后元素选择器 jQuery( ":last" ) 描述:选择与之匹配的最后元素. 例:选择表格的最后一行. <!DOCTYPE html><html lang= ...

  8. Smarty 模板引擎 fetch()和display()函数的区别?

    Smarty模板函数里面有这样一个方法:fetch("template.htm"),他和display("template.htm");最大的不同就是fetch ...

  9. CSS 字体描边

    -webkit-text-stroke: 2px #; text-stroke: 2px #; -o-text-stroke: 2px #;

  10. postgres常用操作

    1. 创建一张表主键自增 create table region( id serial PRIMARY KEY, name ), value ); #会自动创建 region_seq_id表,drop ...