Minimal centos installation mysql5.6 highlights

Source: Internet
Author: User

System Centos6.0

In fact, I usually install the software workstation when installing my own system, and then update all the packages. When installing other software, there is less dependency and less trouble; here I intentionally install the minimal system and install mysql5.6 in the source code package; only solve the problems encountered in the record;

1. Install the yum source;

[root@bogon ~]# rpm -vhi ftp://ftp.univie.ac.at/systems/linux/fedora/epel/beta/6/i386/epel-release-6-5.noarch.rpm

2. Install the compiling environment:

[root@bogon ~]# yum install wget gcc* make -y


[root@bogon ~]# ls *gzcmake-2.8.11.2.tar.gz  mysql-5.6.12.tar.gz

3. Install cmake

tar zxvf cmake-2.8.11.2.tar.gz cd cmake-2.8.11.2./bootstrapmakemake install

4. Install mysql

useradd -s /sbin/nologin mysqlmkdir /datachown -R  mysql.mysql /datatar zxvf mysql-5.6.12.tar.gzcd mysql-5.6.12[root@bogon mysql-5.6.12]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL:STRING=bundled -DWITH_ZLIB:STRING=bundled -DWITH_LIBWARP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all

An error is reported;

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/220J01308-0.jpg "title =" 3.jpg"/>

Install related packages

yum install openssl openssl-devel ncurses ncurses-devel -y

Recompile

rm -rf CMakeCache.txt[root@bogon mysql-5.6.12]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL:STRING=bundled -DWITH_ZLIB:STRING=bundled -DWITH_LIBWARP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_cimakemake install cp support-files/mysql.server /etc/init.d/mysqldchmod +x /etc/init.d/mysqldchkconfig --add mysqldchkconfig mysqld on

5. Adjust the lib library path: Add "/usr/local/mysql/lib/mysql" to the library file search path with the system.

[root@bogon mysql]# vim /etc/ld.so.conf.d/mysql.conf/usr/local/mysql/lib

Ldconfig // refresh to make the modification take effect

6. Set the execution path of the mysql program:

[root@bogon mysql]# vim /etc/profile.d/mysql.shexport PATH=$PATH:/usr/local/mysql/bin[root@bogon mysql]# source /etc/profile

7. input the man document of mysql to the system manual;

yum install manvim /etc/man.configMANPATH /usr/local/mysql/man

8. output the mysql header file to the system header file.

ln -sv /usr/local/mysql/include/ /usr/include/mysql

9. Edit the my. cnf file and initialize it.

[root@bogon mysql]# vim /etc/my.cnf[mysqld]datadir=/datasocket=/tmp/mysql.sockuser=mysqlserver-id=1log-bin=mysql-binreport-port=3306port=3306# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data --user=mysql

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/220J0I46-1.jpg "title =" courier 4.jpg "/>

Now the installation is complete. The relevant compilation parameters are described below:

-DCMAKE_INSTALL_PREFIX =/usr/local/mysql # installation directory-DMYSQL_DATADIR =/data # database storage directory-DSYSCONFDIR =/etc # MySQL configuration file-DWITH_MYISAM_STORAGE_ENGINE = 1 # Install the myisam storage engine -DWITH_INNOBASE_STORAGE_ENGINE = 1 # Install innodb Storage engine-plugin = 1 # Install archive storage engine-plugin = 1 # Install blackhole storage engine-DWITH_LOCAL_INFILE = 1 # Allow local data import-DWITH_READLINE = 1 # shortcut key function-DMYSQL_UNIX_ADDR =/tmp/mysql. sock # Unix socket file path-DDEFAULT_CHARSET = utf8 # default character-DDEFAULT_COLLATION = utf8_general_ci # Check character-DEXTRA_CHARSETS = all # Install all extended character sets-character = 3306-DMYSQL_USER = mysql,-dwit = yes-DWITH_MEMORY_STORAGE_ENGINE = 1 # Install the memory storage engine-DWITH_FEDERATED_STORAGE_ENGINE = 1 # Install the frderated storage engine

The following are some configuration items of my. cnf:

[Client] port = 3309 socket =/home/mysql/tmp/mysql. sock [mysqld]! Include/home/mysql/etc/mysqld. cnf # contains the configuration file and stores the user name and password files separately. port = 3309 socket =/home/mysql/tmp/mysql. sockpid-file =/usr/local/mysql/var/mysql. pidbasedir =/home/mysql/datadir =/usr/local/mysql/var/# tmp dir settingstmpdir =/home/mysql/tmp/slave- load-tmpdir =/home/mysql/tmp/# When slave executes load data infile, use # language =/home/mysql/share/mysql/english/ch Aracter-sets-dir =/home/mysql/share/mysql/charsets/# skip optionsskip-name-resolve # grant, you must use an ip address. You cannot use the host name skip-symbolic-links # You cannot use the connection file skip-external-locking # You must use myisamchk instead of using the system lock, you must disable the server skip-slave-start # start mysql and disable replication # sysdate-is-now # res settingsback_log = 50 # accept the queue, if no tcp connection is established, the request queue is put into the cache. The queue size is back_log, which is restricted from the max_connections = 1000 # maximum number of concurrent connections with the OS parameter, to increase this value, you need to increase the number of file descriptors that can be opened. max_connect_errors = 10000 # If If the number of connection errors initiated by a user exceeds this value, the user's next connection will be blocked until the Administrator executes the flush hosts command; prevent hackers # open_files_limit = 10240connect-timeout = 10 # maximum number of seconds before connection timeout. On the Linux platform, this timeout is also used to wait for the server to respond for the first time. wait-timeout = 28800 # wait for the connection to be closed. interactive-timeout = 28800 # Allow interactive_timeout to replace wait_timeout before closing the connection) the inactive time in seconds. The client's session wait_timeout variable is set to the value of the session interactive_timeout variable. Slave-net-timeout = 600 # The slave server can also handle network connection interruptions. However, net_read_timeout = 30 # timeout for reading information from the server net_write_timeout = 60 # timeout for writing information from the server net_retry_count = 10 # if the read operation on a communication port is interrupted, retry Multiple times before giving up net_buffer_length = 16384 # The packet message buffer is initialized to net_buffer_length bytes, however, the number of tables opened by all threads can be increased to max_allowed_packet byte max_allowed_packet = 64 M # table_cache = 512. Increasing this value can increase the number of file descriptors required by mysqld. thread_stack = 192 K # The stack size of each thread. thread_cache_size = 20 # thread cache thread_concurrency = 8 # the data of the concurrent running thread is best here double the number of CPUs. Number of CPUs configured on the local machine # qcache settingsquery_cache_size = 256 M # query the cache size query_cache_limit = 2 M # No cache query results greater than this value query_cache_min_res_unit = 2 K # query the minimum cache allocation Block size # default settings # time zonedefault-time-zone = system # server time zone character-set-server = utf8 # server-level character set default-storage-engine = InnoDB # default storage # tmp & heaptmp_table_size = 512 M # temporary table size, if this value is exceeded, the result is put into the disk. max_heap_table_size = 512 M # This variable sets the maximum space size that the MEMORY (HEAP) Table can grow to. log-bin = Mysql-bin # these paths relative to datadirlog-bin-index = mysql-bin.indexrelayrelay-log = relay-logrelayrelay_log_index = relay-log.index # warning & error loglog-warnings = 1log-error =/home/mysql/log/mysql. errlog_output = FILE # The log_output parameter specifies the slow query output format. The default format is FILE. You can set it to TABLE, then you can query the slow_log table in the mysql architecture # slow query logslow_query_log = 1long-query-time = 1 # If the slow query time exceeds 1 second, the slow query slow_query_log_file =/home/mysql /Log/slow. log # log-queries-not-using-indexes # log-slow-slave-statementsgeneral_log = 1general_log_file =/home/mysql/log/mysql. logmax_binlog_size = 1Gmax_relay_log_size = 1G # if use auto-ex, set to 0relay-log-purge = 1 # delete logs without relay. This operation is completed by an SQL thread # max binlog keeps daysexpire_logs_days = 30 # binlog deletion over 30 days binlog_cache_size = 1 M # session level # replicationreplicate-wild-ignore-table = mysql. % # ignore database and table replicate-wild-ignore-table = test. % # ignore databases and tables during replication # slave_skip_errors = allkey_buffer_size = 256 M # myisam index buffer, only keys without datasort_buffer_size = 2 M # Sort buffer size; thread-level read_buffer_size = 2 M # buffer size of data scanned in the full table Scan (Sequential Scan) mode; thread-level join_buff Er_size = 8 M # join buffer size; Thread level read_rnd_buffer_size = 8 M # MyISAM uses the Random Scan method to Scan the buffer size of data; thread level bulk_insert_buffer_size = 64 M # size of the tree buffer used by MyISAM in block insertion optimization. Note: This is a per thread restriction. myisam_sort_buffer_size = 64 M # MyISAM sets the buffer size used for table restoration, when you sort the buffer myisam_max_sort_file_size = 10G # MyISAM allocated by the MyISAM INDEX in the repair table, create index, or alter table process, if the temporary file is larger than the INDEX, do not use the Quick Sort index method to create an index. Note: This parameter provides the maximum size of temporary files used by MySQL when re-indexing MyISAM indexes (during repair table, alter table, or load data infile) in bytes. If the file size exceeds this value, it is much slower to use the key value cache to create an index. The unit of this value is byte myisam_repair_threads = 1 # if this value is greater than 1, create the MyISAM Table index in parallel during Repair by sorting (each index is in its own thread) myisam_recover = 64 K # allowed GROUP_CONCAT () the maximum length of the function result transaction_isolation = REPEATABLE-READinnodb_file_per_table # innodb_status_file = 1 # innodb_open_files = 2048innodb_additional_mem_pool_size = 100 M # The control object of the frame cache needs to apply for the cache from here, therefore, this value corresponds to innodb_buffer_pool. innodb_buffer_pool_size = 2G # includes the data page, index page, insert cache, lock information, adaptive hash, and data dictionary information. innodb_dat A_home_dir =/usr/local/mysql/var/# innodb_data_file_path = ibdata1: 1G: autoextendinnodb_data_file_path = ibdata1: 500 M; ibdata2: 2210 M: autoextend # tablespace innodb_file_io_threads = 4 # Number of I/o threads innodb_thread_concurrency = 16 # InnoDB tries to keep the number of operating system threads in InnoDB less than or equal to the limit given by this parameter limit = 1 # each commit log cache data is flushed to the disk innodb_log_buffer_size = 8 M # transaction log cache innodb_log_file_size = 500 M # transaction log size # innodb_log_file_siz E = 100Minnodb_log_files_in_group = 2 # two groups of transaction logs: innodb_log_group_home_dir =/usr/local/mysql/var/# log group metadata = 90 # the innodb main thread refreshes the data in the cache pool, make the proportion of dirty data less than 90% innodb_lock_wait_timeout = 50 # InnoDB transactions can wait for a locked timeout period before being rolled back. InnoDB automatically detects the transaction deadlock and rolls back the transaction in its own locked table. InnoDB uses the lock tables statement to notice the LOCK settings. The default value is 50 seconds # innodb_flush_method = O_DSYNC [mysqldump] quickmax_allowed_packet = 64 M [mysql] disable-auto-rehash # Allow the default-character-set = utf8connect-timeout = 3 prompt via the TAB key


This article is from the Coffee _ Blue Mountains blog, please be sure to keep this source http://lansgg.blog.51cto.com/5675165/1259347

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.