Wu Bingxi Source: http://wubx.net/Contact: wubingxi#163.com Reprint Please specify AS/translator and source, and can not be used for commercial purposes, offenders must investigate.
Download binary version
Http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz
Cd/data
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz
2. Download MySQL extract to/opt/mysql
cd/opt/
mkdir MySQL
CD MySQL
Tar zxvf/data/mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz
3. Create a soft connection
cd/usr/local/
Ln-s/opt/mysql/mysql-5.6.24-linux-glibc2.5-x86_64 MySQL
4. Create a user
Groupadd MySQL
Useradd-g mysql-s/sbin/nologin-d/usr/local/mysql MySQL
5. Create a basic directory based on our configuration file setting
Mkdir/data/mysql
mkdir/data/mysql/mysql3306
cd/data/mysql/mysql3306/
mkdir data
mkdir logs
mkdir tmp
Chown-r mysql:mysql/data/mysql/mysql3306
Create a/ETC/MY.CNF configuration file
(The configuration file does not let the upload prompt illegal type, attached to the article) also can join QQ group: 484942122 get.
or refer to my other MySQL 5.6 configuration reference.
6. Do MySQL initialization
Cd/usr/local/mysql
./scripts/mysql_install_db
7. Create a startup script
CP Support-files/mysql.server/etc/init.d/mysql
8. Start and close
/etc/init.d/mysql start |stop|restart
Start our MySQL learning path.
Note:
This operation is only available for MySQL version 5.6 and below.
Configuration file Reference:
#my. Cnf[client]port = 3306socket = /tmp/mysql.sock[mysql]prompt= "\\[email protected]\\h:\p \\R:\\m:\\s [\\d]> "#tee =/data/mysql/mysql3306/data/ QUERY.LOGNO-AUTO-REHASH[MYSQLD] #miscuser = mysqlbasedir = /usr/local/mysqldatadir = /data/mysql/mysql3306/dataport = 3306socket = /tmp/mysql.sockevent_scheduler = 0#tmptmpdir=/data/mysql/mysql3306/tmp#timeoutinteractive_timeout = 300wait_timeout = 300#character setcharacter-set-server = utf8open_files_limit = 65535max_ Connections = 100max_connect_errors = 100000skip-name-resolve = 1#logslog-output =fileslow_query_log = 1slow_query_log_file = slow.loglog-error = error.loglog_ Warnings = 2pid-file = mysql.pidlong_query_time = 1#log-slow-admin-statements = 1#log-queries-not-using-indexes = 1log-slow-slave-statements = 1#binlogbinlog_format = rowserver-id = 1003306log-bin = /data/mysql/mysql3306/logs/mysql-binbinlog_cache_size = 4mmax_binlog_size = 1gmax_binlog_cache_size = 2gsync_binlog = 0expire_logs_days = 10# relay logskip_slave_start = 1max_relay_log_size = 1grelay_log_purge = 1relay_log_recovery = 1log_slave_updates#slave-skip-errors=1032,1053,1062explicit_defaults_for_ timestamp=1#buffers & cachetable_open_cache = 2048table_definition_cache = 2048table_open_cache = 2048max_heap_table_size = 96msort_buffer_size = 2mjoin_ Buffer_size = 2mthread_cache_size = 256query_cache_size = 0query_cache_type = 0query_cache_limit = 256kquery_cache_min_res_unit = 512thread_stack = 192ktmp_table_size = 96mkey_buffer_size = 8mread_buffer_size = 2mread_rnd_buffer_size = 16mbulk_ Insert_buffer_size = 32m#myisammyisam_sort_buffer_size = 128mmyisam_max_sort_file_size = 10gmyisam_repair_threads = 1#innodbinnodb_buffer_pool_size = 100minnodb_ Buffer_pool_instances = 1innodb_data_file_path = ibdata1:1g:autoextendinnodb_flush_log_at_ Trx_commit = 2innodb_log_buffer_size = 64minnodb_log_file_size = 500minnodb_log_ Files_in_group = 3innodb_max_dirty_pages_pct = 50innodb_file_per_table = 1innodb _rollback_on_timeoutinnodb_status_file = 1innodb_io_capacity = 2000transaction_isolation = read-committedinnodb_flush_method = o_direct[mysqld_safe] #malloc-lib=/usr/local/mysql/ Lib/jmalloc.sonice=-19open-files-limit=65535
This article from "Wu Bingxi-mysql-dba-life" blog, reproduced please contact the author!
3 minutes to install a MySQL