Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL 5.6.26 source install     - Modern Objective-C syntax and new features (Programming)

- The file name is garbled or deleted files with special characters under Linux (Linux)

- Linux Network Programming - raw socket programming (Programming)

- Asynchronous JavaScript loading (Programming)

- Related to optimize the use of Btrfs file system on SSD (Linux)

- Unix / Linux commonly used to clean up disk space command (Linux)

- Linux iptables: Composition Rules (Linux)

- Hardware Firewall Basics (Linux)

- Distributed Hadoop1.2.1 cluster installation (Server)

- Fundamentals of the Java virtual machine memory management principles (Programming)

- Getting the Linux shell flow control statements (Programming)

- Java Foundation - Getting Start (Programming)

- Sublime Text 3 using summary (Linux)

- Android Send HTTP POST requests (Programming)

- Java, boolean operators & =, | = ^ = use (Programming)

- Linux 0.12 kernel and modern kernels difference in memory management (Linux)

- Zabbix monitoring disk IO status (Server)

- Upload the project to GitHub, synchronous remote repository Github (Linux)

- Linux host dual LAN transceiver package ARP problem (Linux)

- Ubuntu system safe and caution sudo su command (Linux)

 
         
  MySQL 5.6.26 source install
     
  Add Date : 2018-11-21      
         
         
         
  Operating system version: CentOS release 6.3 (Final)

Installation :( remember the mirror mount, and configure yum, yum easy installation of various dependent packages)

Configuring CentOS yum:
1, cd /etc/yum.repos.d
2, create arbitrary directory, move all the files to the directory you created in addition to the CentOS-Media.repo
3, edit CentOS-Media.repo
    vi CentOS-Media.repo
[C6-media]
name = CentOS- $ releasever - Media
baseurl = file: /// media / CentOS /
# File: /// media / cdrom /
# File: /// media / cdrecorder /
gpgcheck = 1
enabled = 1
gpgkey = file: /// etc / pki / rpm-gpg / RPM-GPG-KEY-CentOS-6


4. Create / media / CentOS / directory
5. Mount
    mount / dev / cdrom / media / CentOS /


[Root @ hank-yoon ~] # mkdir -p / export / servers

[Root @ hank-yoon servers] # upload installation scripts, MySQL source installation package, Cmake installation package

[Root @ hank-yoon servers] #ls
cmake-2.8.3.tar.gz mysql-5.6.26.tar.gz install.sh

[Root @ hank-yoon servers] #sh install.sh

[Root @ hank-yoon servers] #cat install.sh script contents
#! / Bin / bash


# Check
echo -e " 033 [; 37; 34mCheck Memory Size ... 033 [0m"
if [ `free -g | grep ^ Mem | awk '{print $ 2}'` = 125!]
then
read -p "Memory size is` free -g | grep ^ Mem | awk '{print $ 2}' `G, enter innodb_buffer_pool_size (default 20G):" pool
else
echo -e " 033 [; 37; 32mMemory Size is 125G, innodb_buffer_pool_size set 100G 033 [0m"
fi
echo -e " 033 [; 37; 34mCheck Network ... 033 [0m"
! #if Ping -c 1 -w 1 www.baidu.com> / dev / null; then echo -e " 033 [; 37; 31mPlease Check Network Before Setup 033 [0m"; exit 1; else echo -e " 033 [; 37; 32mOK 033 [0m"; fi
echo -e " 033 [; 37; 34mCheck Packet ... 033 [0m"
! If ls mysql-5.6.26.tar.gz cmake-2.8.3.tar.gz> / dev / null; then echo -e " 033 [; 37; 31mNo Packets 033 [0m"; exit 1; else echo -e " 033 [; 37; 32mOK 033 [0m"; fi
# Replace yum.repos.d
#rm -f /etc/yum.repos.d/*
#wget -P /etc/yum.repos.d/ http://172.22.197.62/CentOS/app/script/CentOS-Media.repo
#sed -i 's / 6.3 / 6.5 /' /etc/yum.repos.d/CentOS-Media.repo
#echo -e " 033 [; 37; 34mreplace yum.repos.d ... 033 [0m"


#wget mysql cmake


#change IO scheduler
echo deadline> / sys / block / sda / queue / scheduler
echo -e " 033 [; 37; 34mchange IO scheduler to deadline ... 033 [0m"


# Init enviroment
echo -e " 033 [; 37; 34mStarting Yum Install ... 033 [0m"
yum install -y ncurses-devel glibc gcc gcc-c ++ libstdc ++ * libtool cmake lrzsz libaio-devel
echo -e " 033 [; 37; 32mYum Install Done 033 [0m"
echo -e " 033 [; 37; 34mAdd MySQL OS User ... 033 [0m"
useradd mysql
echo -e " 033 [; 37; 32mAdd User Done 033 [0m"


setuplog = / home / mysql / logs / install-log
setupdir = $ (pwd)
mysqldir = (/ export / data / mysql / tmp / export / data / mysql / undo / export / data / mysql / data / export / servers / mysql / etc / export / data / mysql / dumps / export / data / mysql / log / home / mysql / scripts / home / mysql / logs)
mkdir -p $ {mysqldir [*]}
chown mysql: mysql -R / export / data / mysql / home / mysql /


echo -e " 033 [; 37; 34mExtracting package to / usr / local / src / 033 [0m"
tar xzf cmake-2.8.3.tar.gz -C / usr / local / src
tar xzf mysql-5.6.26.tar.gz -C / usr / local / src
mv * .tar.gz / usr / local / src
echo -e " 033 [; 37; 32mExtracting Done 033 [0m"


# Install
echo -e " 033 [; 37; 34mInstall Cmake ... 033 [0m"
cd /usr/local/src/cmake-2.8.3; ./bootstrap && gmake && make install
if [? $ = 0]; then echo -e " 033 [; 37; 32mCmake Install Done 033 [0m"; else echo -e " 033 [; 37; 31mCmake Install Faild 033 [0m"; fi


echo -e " 033 [; 37; 34mInstall MySQL ... 033 [0m"
echo "Configure Error"> $ setuplog
cd /usr/local/src/mysql-5.6.26;. cmake -DCMAKE_INSTALL_PREFIX = / export / servers / mysql / -DMYSQL_DATADIR = / export / data / mysql / data -DSYSCONFDIR = / export / servers / mysql / etc -DWITH_INNOBASE_STORAGE_ENGINE = 1 -DWITH_PERFSCHEMA_STORAGE_ENGINE = 1 -DDEFAULT_CHARSET = utf8 -DDEFAULT_COLLATION = utf8_general_ci -DMYSQL_UNIX_ADDR = / export / data / mysql / tmp / mysql.sock -DENABLED_LOCAL_INFILE = ON -DENABLED_PROFILING = ON -DWITH_DEBUG = 0 -DENABLE_DTRACE = OFF -DMYSQL_TCP_PORT = 3358 2 >> $ setuplog
make && make install
if [? $ = 0]; then echo -e " 033 [; 37; 32mMySQL Install Done 033 [0m"; else echo -e " 033 [; 37; 31mMySQL Install Faild 033 [0m"; exit 1 ; fi
/ Sbin / ldconfig / export / servers / mysql / lib /


echo -e " 033 [; 37; 34mModify /home/mysql/.bash_profile...33[0m"
echo "export LANG = en_US.UTF-8" >> /home/mysql/.bash_profile
sed -i '! s PATH = $ PATH: $ HOME / bin PATH = $ PATH:! $ HOME / bin: / export / servers / mysql / bin!' /home/mysql/.bash_profile
source /home/mysql/.bash_profile
echo -e " 033 [; 37; 32mDONE 033 [0m"


# My.cnf
echo -e " 033 [; 37; 34mCreate /export/servers/mysql/etc/my.cnf...33[0m"
cat >> /export/servers/mysql/etc/my.cnf << EOF
[Client]
port = 3358
socket = /export/data/mysql/tmp/mysql.sock


[Mysqld]
port = 3358
socket = /export/data/mysql/tmp/mysql.sock
datadir = / export / data / mysql / data /




# --- GLOBAL --- #
character-set-server = utf8
lower_case_table_names = 1
log-output = FILE
log-error = /export/data/mysql/log/error.log


general_log = 0


general_log_file = /export/data/mysql/log/mysql.log
pid-file = /export/data/mysql/mysql.pid
slow-query-log
slow_query_log_file = /export/data/mysql/log/slow.log
tmpdir = / export / data / mysql / tmp
long_query_time = 1


# # --------------


#thread_concurrency = 16
thread_cache_size = 512
table_open_cache = 16384
table_definition_cache = 16384
sort_buffer_size = 2M
join_buffer_size = 2M
read_buffer_size = 4M
read_rnd_buffer_size = 4M
key_buffer_size = 8M
myisam_sort_buffer_size = 8M
tmp_table_size = 64M
max_heap_table_size = 64M
open_files_limit = 65535
query_cache_size = 0


#add z #################
innodb_undo_directory = / export / data / mysql / undo
innodb_undo_tablespaces = 4
explicit_defaults_for_timestamp = 1


# --- NETWORK --- #
back_log = 1024
max_allowed_packet = 16M
interactive_timeout = 28800
wait_timeout = 28800
skip-external-locking
max-connections = 1000
skip-name-resolve
#read_only = 1
# --- REPL --- #
server-id = 360360
log-bin = mysql-bin
binlog_format = mixed
expire_logs_days = 7
relay-log = relay-log




replicate-ignore-db = mysql.slave_master_info
replicate-ignore-db = mysql.slave_relay_log_info
replicate-ignore-db = mysql.slave_worker_info
replicate-ignore-db = test
replicate-ignore-db = information_schema
replicate-ignore-db = performance_schema




log_slave_updates
skip-slave-start
slave-parallel-workers = 4
sync_master_info = 1
sync_relay_log = 1
sync_relay_log_info = 1
relay_log_info_repository = TABLE
master_info_repository = TABLE
#rpl_semi_sync_master_enabled = 1
#rpl_semi_sync_slave_enabled = 1
#rpl_semi_sync_master_timeout = 1000


# --- INNODB --- #
default-storage-engine = INNODB
innodb_data_home_dir = / export / data / mysql / data
innodb_file_per_table
innodb_log_group_home_dir = / export / data / mysql / data
innodb_log_files_in_group = 3
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 120
innodb_flush_method = O_DIRECT
innodb_max_dirty_pages_pct = 75


#change z #####
sync_binlog = 1
innodb_buffer_pool_size = 100G
innodb_data_file_path = ibdata1: 2G; ibdata2: 2G: autoextend
innodb_autoextend_increment = 500
innodb_thread_concurrency = 32
innodb_open_files = 65535
innodb_write_io_threads = 20
innodb_read_io_threads = 20
innodb_spin_wait_delay = 10
innodb_flush_neighbors = 1
innodb_use_native_aio = 1
innodb_io_capacity = 2000
innodb_io_capacity_max = 6000
relay_log_recovery = 1
#innodb_additional_mem_pool_size = 128M


#change h #####


# Innodb_numa_interleave = ON
innodb_lru_scan_depth = 512
innodb_checksum_algorithm = crc32
innodb_purge_threads = 4




[Mysqldump]
quick
max_allowed_packet = 16M


[Mysql]
# Auto-rehash
# Remove the next comment character if you are not familiar with SQL
# Safe-updates
default-character-set = utf8


[Myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M


[Mysqlhotcopy]
interactive-timeout


EOF
serverid = $ (ifconfig | grep Bcast | grep 'inet addr:' | awk '{print $ 2}' | awk -F '{print $ 3 $ 4}'.)
#serverid = $ (ifconfig eth0 | grep Bcast | grep 'inet addr:' | awk '{print $ 2}' | awk -F '{print $ 3 $ 4}'.)
sed -i 's / 360360 /' $ serverid '/' /export/servers/mysql/etc/my.cnf
if [-z $ pool!]; then sed -i 's / innodb_buffer_pool_size = 100G / innodb_buffer_pool_size =' $ pool '/' /export/servers/mysql/etc/my.cnf;echo -e " 033 [; 37 ; 34m`cat /export/servers/mysql/etc/my.cnf|grep innodb_buffer_pool_size` 033 [0m "; fi
echo -e " 033 [; 37; 32mDONE 033 [0m"


# Start
/ Export / servers / mysql / scripts / mysql_install_db --user = mysql --basedir = / export / servers / mysql / --datadir = / export / data / mysql / data /
/ Export / servers / mysql / bin / mysqld_safe --defaults-file = / export / servers / mysql / etc / my.cnf &
echo -e " 033 [; 37; 34mStart MySQL 033 [0m"
for i in {1..500}; do [-S /export/data/mysql/tmp/mysql.sock] && echo -e " 033 [; 37; 32m [OK] 033 [0m" && break | "." | echo -n; sleep 2; done
if [! -S /export/data/mysql/tmp/mysql.sock]; then echo -e " 033 [; 37; 31m [Start Faild, See /export/data/mysql/log/error.log] 033 [0m "; exit 1; fi




# Cutting
echo -e " 033 [; 37; 34mCreate Cutting.sh to Crontab 033 [0m"
cat >> /home/mysql/scripts/cutting.sh << EOF
#! / Bin / bash
mysql = / export / servers / mysql / bin / mysql
user = backup
password = '7FH3iwIX90VdUInu'


generallog = / export / data / mysql / log / mysql.log
if [-f $ generallog]
then
        mv $ generallog $ {generallog}. `date" +% Y% m% d% H "`
         $ Mysql -u $ user -p $ password -e "flush no_write_to_binlog general logs;"
fi


slowlog = / export / data / mysql / log / slow.log
if [ `date" +% w "` = 6 -a -f $ slowlog]
then
        mv $ slowlog $ {slowlog}. `date" +% Y% m% d% H "`
         $ Mysql -u $ user -p $ password -e "flush no_write_to_binlog slow logs;"
fi


find / export / data / mysql / log / -type f -name "* .log *." -mtime +7 | xargs rm -f
EOF
chown mysql.mysql /home/mysql/scripts/cutting.sh
chmod + x /home/mysql/scripts/cutting.sh
echo "1 0 * * * /home/mysql/scripts/cutting.sh" >> / var / spool / cron / mysql
echo "1 0 * * * / usr / sbin / ntpdate 172.17.1.134 | hwclock -w" >> / var / spool / cron / root
chown mysql.root / var / spool / cron / mysql
chmod 600 / var / spool / cron / mysql
/etc/init.d/crond restart
echo -e " 033 [; 37; 32mDONE 033 [0m"
mkdir / var / lib / mysql
ln -s /export/data/mysql/tmp/mysql.sock /var/lib/mysql/mysql.sock
chown -R mysql.mysql / var / lib / mysql


echo -e " 033 [; 37; 34mClean ... 033 [0m"
> /export/data/mysql/log/mysql.log
rm -f $ {setupdir} / `basename $ 0`
echo -e " 033 [; 37; 32mDONE 033 [0m"


# Add service
cp /export/servers/mysql/support-files/mysql.server /etc/init.d/mysql


# Rpl semi sync ON
/ Export / servers / mysql / bin / mysql -uroot -e "install plugin rpl_semi_sync_master soname 'semisync_master.so'"
/ Export / servers / mysql / bin / mysql -uroot -e "install plugin rpl_semi_sync_slave soname 'semisync_slave.so'";
sed -i 's / # rpl_semi_sync_master_enabled / rpl_semi_sync_master_enabled /' /export/servers/mysql/etc/my.cnf
sed -i 's / # rpl_semi_sync_slave_enabled / rpl_semi_sync_slave_enabled /' /export/servers/mysql/etc/my.cnf
sed -i 's / # rpl_semi_sync_master_timeout / rpl_semi_sync_master_timeout /' /export/servers/mysql/etc/my.cnf


# Mysql restart
service mysql restart
     
         
         
         
  More:      
 
- CentOS 6.5 install Firefox (Linux)
- MySQL binlog group to submit XA (two-phase commit) (Database)
- Java Performance Tuning the proxy mode (Programming)
- Matters Oracle 11.2 single instance when connecting ASM need to pay attention and deal with the problem (Database)
- LinkedList Basic Usage (Programming)
- Sorting algorithm of dichotomy (binary) insertion sort algorithm (Programming)
- RHEL (RedHat) 6.3 using EPEL Yum source (Linux)
- Talk Packages (Linux)
- Java reflection summary (Programming)
- MySQL database master never solve the synchronization method (Database)
- Linux Oracle delete archived logs (Database)
- MongoDB query statistics grouping remove duplicate records (Database)
- grep command Detailed and relevant examples (Linux)
- Linux memory Cache Analysis (Linux)
- How to Install Foreman under Ubuntu (Server)
- MySQL 5.6 Open full query log (Database)
- Git 2.5 increase in the working tree, triangle improved workflow performance (Linux)
- Use chattr and lsattr command to manage linux files and directory attributes (Linux)
- BusyBox making the file system (Linux)
- Django url () function Detailed (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.