Mysql One-click installation Tutorial mysql5.1.45 automatic installation (compile installation) _mysql

Source: Internet
Author: User
Tags chmod mixed mkdir readline socket

I. Source of the problem
install MySQL If you can install one manually, but install multiple, manual installation is cumbersome, you need to write a shell program install_mysql.sh to install

Two. Procedural notes
Install the MySQL5.1.45 to the/home/longxibendi/mysql/usrl/local/mysql
Data files and log files are set in the/home/longxibendi/mysql/3309/
Configuration file my.cnf in/home/longxibendi/mysql/3309
Port uses 3309

Three. SOURCE program install_mysql.sh

#!/bin/bash #author longxibendi #function install MySQL5.1.45 ###################################### Configure and I  
Nstall ##################################################### mkdir-p/home/longxibendi/mysql/usr/local/mysql CD mkdir mysql cd mysql wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.45.tar.gz tar zxvf mysql-5.1.45.tar . GZ cd mysql-5.1.45./configure--prefix=/home/longxibendi/mysql/usr/local/mysql--without-debug--without-bench--e Nable-thread-safe-client--enable-assembler--enable-profiling--with-mysqld-ldflags=-all-static-- With-client-ldflags=-all-static--with-charset=latin1--WITH-EXTRA-CHARSET=UTF8,GBK--with-innodb-- With-mysqld-user=longxibendi--without-embedded-server--with-server-sufix=community--with-unix-socket-path=/ Home/longxibendi/mysql/usr/local/mysql/sock/mysql.sock--enable-assembler--with-extra-charsets=complex-- Enable-thread-safe-client--with-big-tables--with-readline--with-ssl--with-plugins=partition,heap,iNnobase,myisam,myisammrg,csv make-j ' Cat/proc/cpuinfo | grep ' model name ' | Wc-l ' && make install ###################################### set log and data storage path ################ ##################################### chmod +w/home/longxibendi/mysql/usr/local/mysql mkdir-p/home/longxibendi/ Mysql/3309/data/mkdir-p/home/longxibendi/mysql/3309/binlog/mkdir-p/home/longxibendi/mysql/3309/relaylog/##### ################################# Create data file #####################################################/home/ longxibendi/mysql/usr/local/mysql/bin/mysql_install_db--basedir=/home/longxibendi/mysql/usr/local/mysql-- Datadir=/home/longxibendi/mysql/3309/data--user=longxibendi ####################################### Create my.cnf Profile ##################################################### echo "[client] Character-set-server = UTF8 Port = 33 Socket =/home/longxibendi/mysql/usr/local/mysql/sock/mysql.sock [mysqld] Character-set-seRVer = UTF8 replicate-ignore-db = mysql replicate-ignore-db = Test replicate-ignore-db = Information_schema user = my SQL Port = 3309 Socket =/home/longxibendi/mysql/usr/local/mysql/sock/mysql.sock Basedir =/home/longxibendi/mysql da Tadir =/home/longxibendi/mysql/3309/data Log-error =/home/longxibendi/mysql/3309/mysql_error.log Pid-file =/home/ Open_files_limit = 10240 Back_log = longxibendi/mysql/3309/mysql.pid max_connections = 5000 Max_connect_errors = 
6000 Table_cache = 614 External-locking = FALSE Max_allowed_packet = 16M Sort_buffer_size = 1M join_buffer_size = 1M Thread_cache_size = #thread_concurrency = 8 Query_cache_size = 20M Query_cache_limit = 2M Query_cache_min_res_uni  
t = 2k Default-storage-engine = MyISAM Thread_stack = 192K transaction_isolation = read-committed tmp_table_size = 20M 
Max_heap_table_size = 20M Long_query_time = 3 Log-slave-updates log-bin =/home/longxibendi/mysql/3309/binlog/binlog Binlog_cache_size = 4M BinLog_format = MIXED Max_binlog_cache_size = 8M Max_binlog_size = 20M Relay-log-index =/home/longxibendi/mysql/3309/rela Ylog/relaylog Relay-log-info-file =/home/longxibendi/mysql/3309/relaylog/relaylog Relay-log =/home/longxibendi/ Mysql/3309/relaylog/relaylog expire_logs_days = Key_buffer_size = 10M Read_buffer_size = 1M Read_rnd_buffer_size =  
6M bulk_insert_buffer_size = 4M Myisam_sort_buffer_size = 8M Myisam_max_sort_file_size = 20M myisam_repair_threads = 1 Myisam_recover interactive_timeout = Wait_timeout = skip-name-resolve #master-connect-retry = ten slave- Skip-errors = 1032,1062,126,1114,1146,1048,1396 #master-host = 192.168.1.2 #master-user = Username #master-pass  Word = password #master-port = 3309 Server-id = 1 innodb_additional_mem_pool_size = 16M innodb_buffer_pool_size = 20M Innodb_data_file_path = ibdata1:56m:autoextend Innodb_file_io_threads = 4 Innodb_thread_concurrency = 8 Innodb_ Flush_log_at_trx_commit = 2 inNodb_log_buffer_size = 16M Innodb_log_file_size = 20M Innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = in nodb_lock_wait_timeout = innodb_file_per_table = 0 #log-slow-queries =/home/longxibendi/mysql/3309/slow.log #lon G_query_time = [Mysqldump] Quick Max_allowed_packet = 32M ">/home/longxibendi/mysql/3309/my.cnf ##### ########################## Solve bug http://bugs.mysql.com/bug.php?id=37942 ###################################### ####### mkdir-p/home/longxibendi/mysql/share/mysql/english/cp/home/longxibendi/mysql/usr/local/mysql/share/ mysql/english/errmsg.sys/home/longxibendi/mysql/share/mysql/english/############################### start MySQL Server #############################################/bin/sh/home/longxibendi/mysql/usr/local/mysql/bin/mysqld_ Safe--defaults-file=/home/longxibendi/mysql/3309/my.cnf 2>&1 >/dev/null & ########################## ##### try use MySQL Server #############################################/home/longxibendi/mysql/usr/local/mysql/bin/mysql-u root-p-s/home/longxibendi/mysql/usr/local/ 

 Mysql/sock/mysql.sock-p3309-h127.0.0.1-e "Show databases;"

#!/bin/bash #author longxibendi #function install MySQL5.1.45 ###################################### Configure and Inst All ##################################################### mkdir-p/home/longxibendi/mysql/usr/local/mysql CD mkdir MySQL cd mysql wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.45.tar.gz tar zxvf mysql-5.1.45.tar.gz CD mysql-5.1.45./configure--prefix=/home/longxibendi/mysql/usr/local/mysql--without-debug--without-bench-- Enable-thread-safe-client--enable-assembler--enable-profiling--with-mysqld-ldflags=-all-static-- With-client-ldflags=-all-static--with-charset=latin1--WITH-EXTRA-CHARSET=UTF8,GBK--with-innodb-- With-mysqld-user=longxibendi--without-embedded-server--with-server-sufix=community--with-unix-socket-path=/ Home/longxibendi/mysql/usr/local/mysql/sock/mysql.sock--enable-assembler--with-extra-charsets=complex-- Enable-thread-safe-client--with-big-tables--with-readline--with-ssl--with-plugins=partition,heap,innobase, MyisaM,myisammrg,csv make-j ' Cat/proc/cpuinfo | grep ' model name ' | Wc-l ' && make install ###################################### set log and data storage path ################## ################################### chmod +w/home/longxibendi/mysql/usr/local/mysql mkdir-p/home/longxibendi/ Mysql/3309/data/mkdir-p/home/longxibendi/mysql/3309/binlog/mkdir-p/home/longxibendi/mysql/3309/relaylog/###### ################################ Create data file #####################################################/home/ longxibendi/mysql/usr/local/mysql/bin/mysql_install_db--basedir=/home/longxibendi/mysql/usr/local/mysql-- Datadir=/home/longxibendi/mysql/3309/data--user=longxibendi ####################################### Create my.cnf Profile ##################################################### echo "[client] Character-set-server = UTF8 Port = 3309
Cket =/home/longxibendi/mysql/usr/local/mysql/sock/mysql.sock [mysqld] character-set-server = UTF8 Replicate-ignore-db = mYsql replicate-ignore-db = Test Replicate-ignore-db = Information_schema user = MySQL Port = 3309 socket =/home/longxib Endi/mysql/usr/local/mysql/sock/mysql.sock Basedir =/home/longxibendi/mysql DataDir =/home/longxibendi/mysql/3309/ Data Log-error =/home/longxibendi/mysql/3309/mysql_error.log Pid-file =/home/longxibendi/mysql/3309/mysql.pid Open_ Files_limit = 10240 Back_log = max_connections = 5000 Max_connect_errors = 6000 Table_cache = 614 external-locking = 
FALSE Max_allowed_packet = 16M Sort_buffer_size = 1M Join_buffer_size = 1M thread_cache_size = #thread_concurrency = 8 Query_cache_size = 20M Query_cache_limit = 2M Query_cache_min_res_unit = 2k Default-storage-engine = MyISAM thread_stack = 192K Transaction_isolation = read-committed Tmp_table_size = 20M Max_heap_table_size = 20M Long_query_time = 3 Log-slave -updates Log-bin =/home/longxibendi/mysql/3309/binlog/binlog Binlog_cache_size = 4M Binlog_format = MIXED Max_binlog_ Cache_size = 8M Max_binlog_size = 20M rElay-log-index =/home/longxibendi/mysql/3309/relaylog/relaylog Relay-log-info-file =/home/longxibendi/mysql/3309/ Relaylog/relaylog Relay-log =/home/longxibendi/mysql/3309/relaylog/relaylog Expire_logs_days = Key_buffer_size = 10M read_buffer_size = 1M Read_rnd_buffer_size = 6M Bulk_insert_buffer_size = 4M myisam_sort_buffer_size = 8M myisam_max_s Ort_file_size = 20M myisam_repair_threads = 1 Myisam_recover interactive_timeout = Wait_timeout = = Skip-name-reso Lve #master-connect-retry = slave-skip-errors = 1032,1062,126,1114,1146,1048,1396 #master-host = 192.168.1.2 #maste R-user = Username #master-password = password #master-port = 3309 Server-id = 1 Innodb_additional_mem_pool_size = 16M innodb_buffer_pool_size = 20M Innodb_data_file_path = ibdata1:56m:autoextend innodb_file_io_threads = 4 innodb_ Thread_concurrency = 8 Innodb_flush_log_at_trx_commit = 2 Innodb_log_buffer_size = 16M innodb_log_file_size = 20M innodb_l Og_files_in_group = 3 Innodb_max_dirty_pages_pct = innodb_lock_wait_timeout = innodb_file_per_table = 0 #log-slow-queries =/home/longxibendi/mysql/3309/slow . log #long_query_time = [Mysqldump] Quick Max_allowed_packet = 32M ">/home/longxibendi/mysql/3309/my.cnf ##### ########################## Solve bug http://bugs.mysql.com/bug.php?id=37942 ###################################### ####### mkdir-p/home/longxibendi/mysql/share/mysql/english/cp/home/longxibendi/mysql/usr/local/mysql/share/ mysql/english/errmsg.sys/home/longxibendi/mysql/share/mysql/english/############################### start MySQL Server #############################################/bin/sh/home/longxibendi/mysql/usr/local/mysql/bin/mysqld_ Safe--defaults-file=/home/longxibendi/mysql/3309/my.cnf 2>&1 >/dev/null & ########################## ##### try use MySQL Server #############################################/home/longxibendi/mysql/usr/local/mysql/bin /mysql-u root-p-s/home/longxibendi/mysql/usr/local/mysql/sock/mysql. sock-p3309-h127.0.0.1-e "Show databases;"

 

Four. Successful installation results

When the installation is complete, direct return will see the following information
Information_schema
Mysql
Test

The above is the MySQL 5.1.45 compile installation configuration method, hope to be helpful to everybody's study.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.