Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选

首页 / 数据库 / MySQL / centos下的mysql单实例安装

centos下的mysql单实例安装2013-04-14系统环境:centos 6.2 64位

内核版本: 2.6.32-220.el6.x86_64

mysql版本:5.1.62

1、1首先创建mysql用户和组:

[root@cqb ~]# groupadd mysql

[root@cqb ~]# useradd -s /sbin/nologin -g mysql -M mysql

1、2下载mysql源码包后解压安装。

[root@cqb ~]# wget http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.62.tar.gz

[root@cqb ~]# tar zxvf mysql-5.1.62.tar.gz

[root@cqb ~]# cd mysql-5.1.62

[root@cqb mysql-5.1.62]# ./configure --prefix=/usr/local/mysql --enable-assembler --enable-thread-safe-client --with-mysqld-user=mysql --with-big-tables --without-debug --with-pthread --with-extra-charsets=complex --with-readine --with-ssl --with-embedded-server --enable-local-infole --with-plugin=partition,innobase --with-plugin-PLUGIN --with-mysqld-ldflags=-all-static --with-client-ldfags=-all-static

[root@cqb mysql-5.1.62]# make && make install

1、3 mysql参数说明:

--prefix=/usr/local/mysql   #指定mysql的安装路径

--enable-assembler  #允许使用汇编模式(优化性能)

--enable-thread-safe-client  #以线程方式编译mysql

--with-mysqld-user=mysql  #指定mysql运行的系统的用户

--with-big-tables #支持大表,即使是32位的系统也能支持4G以上的表

--without-debug  #使用非debug模式

--with-pthread   #强制使用pthread线程库编译

--with-extra-charsets=complex   #mysql默认的字符集使用complex

--with-ssl    #支持ssl

--with-plugin=partition,innobase

--with-plugin-PLUGIN

--with-mysqld-ldflags=-all-static   #服务器使用静态库(优化性能)

--with-client-ldfags=-all-static    #客户端使用静态库(优化性能)

更多参数请看源码目录的INSTALL或者./configure --help