mysql5.5.20原始碼安裝
rpm -qa|grep bison
rpm -qa|grep ncurses-devel
yum install bison
yum install ncurses-devel.x86_64
從http://www.cmake.org/cmake/resources/software.html
下載cmake-2.8.7.tar.gz
從mysql.com
下載Source Code package : mysql-5.5.20.tar.gz
安裝cmake
# tar zxvf cmake-2.8.7.tar.gz
# cd cmake-2.8.7
# ./bootstrap
# gmake
# gamke install
安裝mysql
tar zxvf mysql-5.5.20.tar.gz
cd mysql-5.5.20
cmake -DCMAKE_INSTALL_PREFIX=/data/mysql \
-DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=gbk \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_DATADIR=/data/mysql/data \
-DSYSCONFDIR=/data/mysql \
-DMYSQL_TCP_PORT=3306
# make
# make install
# groupadd mysql
# useradd -r -g mysql mysql
# chown -R mysql:mysql /home/mysqldata/
cp /mysqlfile/mysql-5.5.20/support-files/my-large.cnf /data/mysql/my.cnf
cp /mysqlfile/mysql-5.5.20/support-files/mysql.server /etc/init.d/mysqld
chown mysql:mysql /data/mysql/my.cnf
chown mysql:mysql /etc/init.d/mysqld
chmod 744 /etc/init.d/mysqld
chmod +x scripts/mysql_install_db
scripts/mysql_install_db \
--defaults-file=/data/mysql/my.cnf \
--basedir=/data/mysql/ \
--datadir=/data/mysql/data/ \
--user=mysql \
--skip-name-resolve
#增加PATH設定
PATH=$PATH:/data/mysql/bin
# . ~/.bash_profile
# chkconfig --add mysqld
###### chkconfig --level 345 mysqld on
# /etc/init.d/mysqld start OR mysqld_safe & OR service mysqld start
###### mysqld_multi
#修改密碼
# mysqladmin -uroot password "xxxxxx"
引數配置:
[mysqld]
server_id=1
federated
datadir=/data/mysql/data
tmpdir=/data/mysql/tmp
skip-external-locking
key_buffer_size = 256M
myisam_sort_buffer_size = 64M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 24
back_log = 1024
max_connections = 1200
table_definition_cache=120000
table_open_cache =120000
max_connect_errors = 300
max_allowed_packet = 24M
read_rnd_buffer_size = 4M
read_buffer_size = 4M
join_buffer_size = 4M
sort_buffer_size = 2M
query_cache_limit = 2M
query_cache_size = 1024M
query_cache_min_res_unit=2k
thread_cache_size = 1200
thread_stack = 128K
tmp_table_size = 256M
max_tmp_tables = 256
bulk_insert_buffer_size = 4M
binlog_cache_size = 2M
max_binlog_size = 128M
max_binlog_cache_size= 512M
# log
log-error=/data/mysql/log/log
log-bin=/data/mysql/log/mysql-bin
slow-query-log
slow-query-log-file=/data/mysql/log/slow.log
long_query_time=1
log-queries-not-using-indexes
# innodb
innodb_buffer_pool_size = 20480M
innodb_data_home_dir = /data/mysql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table= 1
innodb_log_group_home_dir = /data/mysql/log
innodb_log_files_in_group=3
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
#innodb_file_io_threads = 4
innodb_thread_concurrency = 24
innodb_lock_wait_timeout = 100
innodb_flush_method = 'O_DIRECT'
innodb_max_dirty_pages_pct = 75
# innodb_flush_log_at_trx_commit=2
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-715414/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 原始碼安裝mysql5.5.20升級到mysql5.6.25原始碼MySql
- LAMP原始碼安裝+wordpress安裝LAMP原始碼
- nginx原始碼安裝Nginx原始碼
- 原始碼安裝postgresql原始碼SQL
- 原始碼安裝openresty原始碼REST
- 原始碼安裝GO原始碼Go
- Nginx 原始碼安裝Nginx原始碼
- mysql原始碼安裝MySql原始碼
- zabbix原始碼安裝原始碼
- 原始碼安裝lamp原始碼LAMP
- 原始碼安裝MySQL原始碼MySql
- 原始碼安裝Nginx原始碼Nginx
- 【推薦 - 原始碼安裝】nginx - 安裝原始碼Nginx
- yum安裝與原始碼安裝比較原始碼
- MySQL 5.7.28 原始碼安裝MySql原始碼
- docker原始碼安裝NginxDocker原始碼Nginx
- macbook 原始碼安裝 redisMac原始碼Redis
- macbook 原始碼安裝 nginxMac原始碼Nginx
- Centos原始碼安裝NginxCentOS原始碼Nginx
- Redis 4.0原始碼安裝Redis原始碼
- mysql 5.1原始碼安裝MySql原始碼
- mysql-原始碼安裝MySql原始碼
- 原始碼安裝python原始碼Python
- MYSQL 5.6.27原始碼安裝MySql原始碼
- PostgreSQL 10.12 安裝系列 - 原始碼安裝SQL原始碼
- Mysql for Linux安裝配置之—— 原始碼安裝MySqlLinux原始碼
- 連網安裝mysql與原始碼安裝mysqlMySql原始碼
- PostgreSQL-原始碼安裝(一)SQL原始碼
- 原始碼安裝Nginx和PHP原始碼NginxPHP
- 原始碼包安裝過程原始碼
- 原始碼安裝PHP的坑原始碼PHP
- paramiko 2.4.1原始碼安裝原始碼
- 原始碼編譯安裝Redis原始碼編譯Redis
- EOS原始碼分析(1)安裝原始碼
- LAMP原始碼編譯安裝LAMP原始碼編譯
- 安裝mysql原始碼出錯MySql原始碼
- MySQL 5.6.26原始碼安裝MySql原始碼
- Percona XtraBackup 原始碼安裝原始碼