- root user
- preconfiguration setup
- source build (option - https://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html)
mkdir -p /data/mysql
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz
tar xvfz mysql-5.6.10.tar.gz
cd mysql-5.6*
rm CMakeCache.txt
cmake -DCMAKE_INSTALL_PREFIX=/data/mysql \
-DMYSQL_DATADIR=/data/mysqldb \
-DSYSCONFDIR=/etc/mysql \
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk
.
make
make install
- postinstallation setup
- run
- init.d shell
- path
- my.cnf
- ---------------------------------------------------------------------------------------------------------
- #
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /data/mysqld/mysqld.pid
socket = /data/mysqld/mysqld.sock
port = 3306
basedir = /data/mysql
datadir = /data/mysqldb
tmpdir = /tmp
#lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = localhost
bind-address = 0.0.0.0
#server-id=1;
#binlog-do-db=boss #需要记录进制日志的数据库.如果有多个数据库可用逗号分隔,或者使用多个binlog-do-db选项
#binlog-ignore-db=mysql #不需要记录进制日志的数据库.如果有多个数据库可用逗号分隔,或者使用多个binlog-do-db选项
#replicate-do-db=boss #需要进行同步的数据库.如果有多个数据库可用逗号分隔,或者使用多个replicate-do-db选项
#replicate-ignore-db=mysql,information_schema #不需要同步的数据库.如果有多个数据库可用逗号分隔,或者使用多个replicate-ignore-db选项
#同步参数:
#保证slave挂在任何一台master上都会接收到另一个master的写入信息
#log-slave-updates
#sync_binlog=1
#auto_increment_offset=1
#auto_increment_increment=2
#slave-skip-errors=all #过滤掉一些没啥大问题的错误
#
# * Fine Tuning
#
key_buffer = 512M
max_allowed_packet = 28M
thread_stack = 256K
thread_cache_size = 64
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = default
max_connections = 5000
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 512M
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /data/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /data/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
server-id = 1
#log_bin = /data/mysql/logbin/mysql-bin.log
#expire_logs_days = 10
#max_binlog_size = 1000M
#binlog_do_db = boss
#binlog_ignore_db = mysql
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
#log_bin_trust_function_creators=1
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
#!includedir /etc/mysql/conf.d/