1. Unzip MySQL
TAR-XF mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz-c/USR/LOCALMV mysql-5.6.30-linux-glibc2.5-x86_64 mysql-5.6.30
2. Adding users and Groups
Groupadd mysqluseradd-g mysql mysql-s/sbin/nologin chown-r mysql:mysql mysql-5.6.30
3. Install the database
MKDIR/USR/LOCAL/MYSQL-5.6.30/DATA3306CD mysql-5.6.21/scripts./mysql_install_db--user=mysql--basedir=/usr/local/ mysql-5.6.30/--datadir=/usr/local/mysql-5.6.30/data3306/
4. Configuration files
CD/USR/LOCAL/MYSQL-5.6.30/SUPPORT-FILESCP MY-DEFAULT.CNF/ETC/MY.CNFCP mysql.server/etc/init.d/mysqlvim/etc/ Init.d/mysql
Modify the two change values in a file
[mysqld]port = 3306socket = /var/lib/mysql/mysql.sockmax-connections = 800skip-name-resolveskip-external-lockingkey_buffer_size = 384mmax_allowed_packet = 1073mtable_open_cache = 512sort_buffer_size = 512kread_buffer_size = 512kread_ Rnd_buffer_size = 512kjoin_buffer_size = 128kmyisam_sort_buffer_size = 64mthread _cache_size = 256query_cache_size = 0query_cache_type = 0tmp_table_size = 64mmax_heap_table_size = 64mbasedir=/usr/local/mysql-5.6.30/datadir=/usr/local/mysql-5.6.30/ data3306pid-file = /usr/local/mysql-5.6.30/data3306/mysql.pidlog_error = /var/log/ mysqld.log# set binary logging is required for replicationlog-bin= Mysql-binbinlog_cache_size = 32m# event_scheduler shutOff in mysqld slaveevent_scheduler = 1binlog_format=rowexpire_logs_days = 3 # set slow logslow_query_log = 1long_query_time = 2#set character Character_ set_server = utf8#set Case Sensitive Lower_case_table_names=1# set innodb paramsinnodb_ data_home_dir = /usr/local/mysql-5.6.30/data3306innodb_data_file_path = ibdata1:2000m; Ibdata2:10m:autoextendinnodb_log_group_home_dir = /usr/local/mysql-5.6.30/data3306innodb_buffer_pool _size = 5972minnodb_additional_mem_pool_size = 10minnodb_log_file_size = 512minnodb_log_buffer_size = 16minnodb_flush_log_at_trx_commit = 2innodb_flush_method = o_directinnodb_file_per_table = 1innodb_lock_wait_timeout = 10[client] Default-character-set = utf8
5. Configure Environment variables
Vi/etc/profileexport mysql_home= "/usr/local/mysql-5.6.30" Export path= "$PATH: $MYSQL _home/bin"
6. Add a self-starting service
Chkconfig MySQL on
7. Start MySQL
Service MySQL Start
8. Login MySQL and change password
mysqladmin-u root password ' your_password ' #修改root用户密码mysql-u root-p #登录mysql, need to enter a password
This article from "Do not abandon!" Do not give up "blog, be sure to keep this source http://thedream.blog.51cto.com/6427769/1835751
Install mysql5.6.30 under centos6.5