Installation and deployment of 64-bit MySQL in Linux

Source: Internet
Author: User

Innodb_buffer_pool_size of innodb can only be up to 2 GB on 32 machines. In this way, the increase in memory is insufficient to speed up. I heard that the 64-bit environment can use more than 2 GB of memory, so I began to redeploy.

Environment:

CentOS 5.3 64-bit

Mysql 5.1.33

Install

Centos installation is nothing special, just remember to download 64 of the system,

For MYSQL compilation and installation, it is also very simple for people who have installed it. here we will write some processes for your reference.

After installing Centos, follow these steps:

1. Change the yum source of CentOS

Cd/etc/yum. repos. d/
Mv CentOS-Base.repo CentOS-Base.repo.bak
Wget http://blog.s135.com/soft/linux/centos/5.2/CentOS-Base.repo
2. timed calibration of server clock

Yum install ntp # skip this step if ntp has been installed.
Crontab-e
Add the following line:

15 3 ***/usr/sbin/ntpdate 210.72.145.44>/dev/null 2> & 1

3. Install the required Program

LANG = C
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses- devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel
4. Download Software

Mkdir-p/opt/software
Wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.33.tar.gz/from/http://mysql.he.net/
Wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9-rc1.tar.gz
 
5. Compile and install software
5.2 compile and install mysql
Save the following content as a mysql-install.sh

/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql
Tar zxvf mysql-5.1.33.tar.gz

# Sphinx Installation
Cd/opt/software

Tar zxvf sphinx-0.9.9-rc1.tar.gz-C/opt
Cd/opt/sphinx-0.9.9-rc1
Cp-R/opt/sphinx-0.9.9-rc1/mysqlse/opt/mysql-5.1.33/storage/sphse

Cd/opt/mysql-5.1.33

Sh BUILD/autorun. sh

Cd mysql-5.1.33/
. /Configure -- prefix =/usr/local/webserver/mysql/-- without-debug -- without-plugin -- enable-thread-safe-client -- enable-plugin er -- enable-profiling -- -mysqld-ldflags =-all-static -- with-client-ldflags =-all-static -- with-charset = latin1 -- with-extra-charsets = utf8 -- with-plugins = innobase -- with-mysqld-user = mysql -- without-embedded-server -- with-server-suffix =-yicike -- enable-local-infile -- with-plugins = sphins -- with-plugins = all -- with-unix-socket-path =/usr/local/webserver/mysql/sock/mysql. sock
 

Make & make install
Chmod + w/usr/local/webserver/mysql
Chown-R mysql: mysql/usr/local/webserver/mysql
Cd ../
Run (skip this step if not saved as mysql-install.sh)

Chmod + x mysql-install.sh
/Mysql-install.sh
5.2.1 create a MySQL database storage directory www.britepic.org

Mkdir-p/data/mysql/data/
Chown-R mysql: mysql/data/mysql/
5.2.2 create a data table as a mysql user account

/Usr/local/webserver/mysql/bin/mysql_install_db -- basedir =/usr/local/webserver/mysql -- datadir =/data/mysql/data -- user = mysql
 
May fail. If mysql is installed on the machine, you need to change the name of my. cnf TO my. cnf. temp.
5.2.3 create my. cnf configuration file

Vim/data/mysql/my. cnf
Enter the following content

[Client]
Default-character-set = utf8
Port = 3306
Socket =/tmp/mysql. sock

[Mysql]
Prompt = "(\ u: www.yicike.com :) [\ d]>"
No-auto-rehash

[Mysqld]
Default-character-set = utf8
User = mysql
Port = 3306
Socket =/tmp/mysql. sock
Basedir =/usr/local/webserver/mysql
Datadir =/data/mysql/data
Open_files_limit = 10240
Back_log = 600
Max_connections = 1000
Max_connect_errorrs = 6000
Table_cache = 614
External-locking = FALSE
Max_allowed_packet = 32 M
Sort_buffer_size = 2 M
Join_buffer_size = 2 M
Thread _ cache_size = 300
Thread_concurrency = 8
Query_cache_size = 32 M
Query_cache_limit = 2 M
Query_cache_min_res_unit = 2 k
Default-storage-engine = MyISAM
Default_table_type = MyISAM
Thread_stack = 192 K
Transaction_isolation = READ-COMMITTED
Tmp_table_size = 246 M
Max_heap_table_size = 246 M
Long_query_time = 1
Log_long_format
Log-bin =/data/mysql/binlog
Binlog_cache_size = 4 M
Binlog_format = MIXED
Max_binlog_cache_size = 8 M
Max_binlog_size = 512 M
Expire_logs_days = 7
Key_buffer_size = 256 M
Read_buffer_size = 1 M
Read_rnd_buffer_size = 16 M
Bulk_insert_buffer_size = 64 M
Myisam_sort_buffer_size = 128 M
Myisam_max_sort_file_size = 10G
Myisam_max_extra_sort_file_size = 10G
Myisam_repair_threads = 1
Myisam_recover

Skip-name-resolve
Master-connect-retry = 10
# Slave-skip-errors = 1396

Server-id = 2

Innodb_additional_mem_pool_size = 16 M
Innodb_buffer_pool_size = 8G # Because my machine is 16G
Innodb_data_file_path = ibdata1: 1024 M: autoextend
Innodb_file_io_threads = 4
Innodb_thread_concurrency = 8
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 16 M
Innodb_log_file_size = 128 M
Innodb_log_files_in_group = 3
Innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_file_per_table = 0
[Mysqldump]
Quick
Max_allowed_packet = 32 M

  • 1
  • 2
  • Next Page

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.