[mysql]-two-in-plate installation-manual version

Source: Internet
Author: User
Tags dba mkdir mysql version administrator password

1.MySQL Mounting Mode selection

  1.1 Yum Direct Installation

The installation is very simple and suitable for use when there is no requirement for MySQL.

Normal basic does not consider Yum installation (development of local installed client can be used), can not modify the installation path, resulting in a server can only install a MySQL, to install the new need to first uninstall

  1.2 RPM Package Installation

You can choose the MySQL version to download. Basically similar to Yum, except that you go to the RPM installation package

With Yum

  1.2 Binary installation (free-build version)

Simple installation (relative source installation, without directed compilation), equivalent to the source code compiled a generic version, the MySQL system has basic control, at least at the same time there are multiple MySQL version

Performance is not as good as source code compilation, because the source code compilation can be customized to compile parameters, so that the final version directed in an environment or an operating system to have additional operational efficiency improvement.

  1.3 Source Installation

Highest performance (in a unified environment), maximum intervention for MySQL systems (even self-decomposing components, etc.)

Edit parameter configuration is complex, compile time is long,

Here to choose the binary installation, yum,rpm basically does not consider. Also not up to the point where custom compilation is required to improve performance

2. Preparing the installation package

Mysql-5.6.23-linux-glibc2.5-x86_64.tar

Upload to Server

3. Installation

3.1 Install here

#mkdir/usr/local

#mv/opt/software/mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz/usr/local/

#cd/usr/local

3.2 Checking for presence

#ps-ef|grep mysqld

#rpm-qa |grep-i MySQL

3.3 Unpacking && renaming

#tar XZVF mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz

#mv mysql-5.6.23-linux-glibc2.5-x86_64 MySQL

3.4 Creating a user group

#groupadd-G 101 dba

3.5 Creating an Administrator

#useradd-u 514-g dba-g root-d/usr/local/mysql mysqladmin

  If mysqladmin already exists #usermod-u 514-g dba-g root-d/usr/local/mysql mysqladmin #

Check #id mysqladmin.

  

Set the administrator password #passwd mysqladmin

3.6 Asynchronous non-blocking interface components

#yum-y Install Libaio

3.7 Configuring individual environment variables

#cp/etc/skel/.*/usr/local/mysql

#vi/etc/my.cnf

Overwrite the following content

  

[Client]
Port = 3306
Socket =/usr/local/mysql/data/mysql.sock

[Mysqld]
Port = 3306
Socket =/usr/local/mysql/data/mysql.sock

Skip-external-locking
Key_buffer_size = 256M
Sort_buffer_size = 2M
Read_buffer_size = 2M
Read_rnd_buffer_size = 4M
Query_cache_size= 32M
Max_allowed_packet = 16M
myisam_sort_buffer_size=128m
tmp_table_size=32m

Table_open_cache = 512
Thread_cache_size = 8
Wait_timeout = 86400
Interactive_timeout = 86400
Max_connections = 600

# Try number of CPU ' s*2 for thread_concurrency
Thread_concurrency = 32

#isolation level and default engine
Default-storage-engine = INNODB
Transaction-isolation = read-committed

Server-id = 1
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Pid-file =/usr/local/mysql/data/hostname.pid

#open Performance Schema
Log-warnings
Sysdate-is-now

Binlog_format = MIXED
Log_bin_trust_function_creators=1
Log-error =/usr/local/mysql/data/hostname.err
Log-bin=/usr/local/mysql/arch/mysql-bin
#other logs
#general_log =1
#general_log_file =/usr/local/mysql/data/general_log.err
#slow_query_log =1
#slow_query_log_file =/usr/local/mysql/data/slow_log.err

#for Replication Slave
#log-slave-updates
#sync_binlog = 1

#for InnoDB Options
Innodb_data_home_dir =/usr/local/mysql/data/
Innodb_data_file_path = Ibdata1:500m:autoextend
Innodb_log_group_home_dir =/usr/local/mysql/arch
Innodb_log_files_in_group = 2
Innodb_log_file_size = 200M

Innodb_buffer_pool_size = 2048M
Innodb_additional_mem_pool_size = 50M
Innodb_log_buffer_size = 16M

Innodb_lock_wait_timeout = 100
#innodb_thread_concurrency = 0
Innodb_flush_log_at_trx_commit = 1
Innodb_locks_unsafe_for_binlog=1

#innodb io features:add for mysql5.5.8
Performance_schema
Innodb_read_io_threads=4
Innodb-write-io-threads=4
innodb-io-capacity=200
#purge Threads Change Default (0) to 1 for purge
Innodb_purge_threads=1
Innodb_use_native_aio=on

#case-sensitive file names and separate tablespace
innodb_file_per_table = 1
Lower_case_table_names=1

[Mysqldump]
Quick
Max_allowed_packet = 16M

[MySQL]
No-auto-rehash

[Mysqlhotcopy]
Interactive-timeout

[Myisamchk]
Key_buffer_size = 256M
Sort_buffer_size = 256M
Read_buffer = 2M
Write_buffer = 2M

3.8 Environment configuration file right

#chown mysqladmin:dba/etc/my.cnf

#chmod 640/etc/my.cnf

Check the #ll/etc/my.cnf, please.

  

3.9 Changing the standalone environment profile to MySQL administrator

#chown-R Mysqladmin:dba/usr/local/mysql

#chmod-R 755/usr/local/mysql

4.MySQL initialization

4.1 Switch to MySQL Administrator account

#su-mysqladmin

Look at #pwd.

#mkdir Arch

  4.2 Initialization

#scripts/mysql_install_db--user=mysqladmin--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data

5. Set up boot from boot

# Cd/usr/local/mysql

Copy the service file to INIT.D and rename it to MySQL # cp Support-files/mysql.server/etc/rc.d/init.d/mysql

Give executable permissions # chmod +x/etc/rc.d/init.d/mysql

Delete Service # chkconfig--del MySQL

Add Service # chkconfig--add MySQL

# chkconfig--level 345 MySQL on

  

6. Start MySQL

Or cut to MySQL administrator # Su-mysqladmin

# RM-RF MY.CNF

# Bin/mysqld_safe &

  

  

[mysql]-two-in-plate installation-manual version

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.