linux安装mysql5.5数据库_Linux下编译安装MySQL5.5

RHEL5 / OL5 / CentOS5 / SLES10 / SLES11 / openSUSE is OK!

preparation

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel ssse2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gettext-devel libXpm-devel libtool

on Novell SuSE Linux

zypper install gcc gcc-c++ bison patch unzip mlocate flex wget automake autoconf gd cpp gettext readline-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel libidn libidn-devel openldap openldap-devel openldap-clients openldap-servers nss_ldap expat-devel libtool libtool-ltdl-devel bison libevent gpgme gpgme-devel

[root@dbtest opt]# useradd MySQL -s /sbin/nologin

[root@dbtest opt]# mkdir -p /data/mysql /service

编译安装cmake

[root@dbtest opt]# tar -zxvf cmake-2.8.9.tar.gz

[root@dbtest opt]# cd cmake-2.8.9

[root@dbtest cmake-2.8.9]# ./configure

[root@dbtest cmake-2.8.9]# make && make install

安装mysql

[root@dbtest opt]# tar -zxvf mysql-5.5.27.tar.gz

[root@dbtest opt]# cd mysql-5.5.27

[root@dbtest mysql-5.5.27]# cmake . -DCMAKE_INSTALL_PREFIX=/service/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/service/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_EXAMPLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=30307 -DCOMPILATION_COMMENT=Master_DB -DWITH_DEBUG=0

[root@dbtest mysql-5.5.27]# make && make install

参数文件

[root@dbtest mysql-5.5.27]# cat /service/mysql/my.cnf

[client]

port            = 30307

socket          = /data/mysql/mysql.sock

[mysqld]

port            = 30307

socket          = /data/mysql/mysql.sock

skip-external-locking

back_log = 500

lower_case_table_names = 1

skip-name-resolve

max_connections = 1024

table_open_cache = 512

binlog_cache_size = 1M

max_heap_table_size = 300M

read_buffer_size = 10M

read_rnd_buffer_size = 16M

sort_buffer_size = 8M

join_buffer_size=4M

thread_cache_size = 4

thread_concurrency = 4

query_cache_size = 200M

ft_min_word_len = 4

thread_stack = 192K

tmp_table_size = 200M

slow_query_log

long_query_time = 2

slow_query_log_file = /data/mysql/slowsql.sql

key_buffer_size = 32M

bulk_insert_buffer_size = 64M

myisam_sort_buffer_size = 128M

myisam_max_sort_file_size = 200M

myisam_repair_threads = 4

myisam_recover

# setup innodb

innodb_flush_log_at_trx_commit = 0

innodb_additional_mem_pool_size = 16M

innodb_buffer_pool_size = 2500M

innodb_data_file_path = ibdata1:10M:autoextend

innodb_write_io_threads = 4

innodb_read_io_threads = 4

innodb_thread_concurrency = 16

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 8M

innodb_log_file_size = 512M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

init_connect = 'SET autocommit=0'

innodb-file-per-table = 1

innodb-open-file = 500

innodb_flush_method=O_DIRECT

expire_logs_days = 5

federated

event_scheduler = 1

log-bin=binlog-master

binlog_format=mixed

server-id      = 1

[mysqldump]

quick

max_allowed_packet = 16M

[mysql]

no-auto-rehash

[myisamchk]

key_buffer_size = 128M

sort_buffer_size = 128M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

[root@dbtest mysql-5.5.27]#0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值