Centos MySQL 5.6 Installation

Source: Internet
Author: User
Tags change settings

#wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz
Yum-y install make gcc-c++ cmake bison-devel ncurses-devel
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.25.tar.gz

Gunzip mysql-5.6.25.tar.gz
TAR-XVF Mysql-5.6.25.tar
CD mysql-5.6.25


#参数参考

/*
-dcmake_install_prefix=dir_name
-dinstall_bindir=dir_name
-dinstall_docdir=dir_name
-dinstall_docreadmedir=dir_name
-dinstall_includedir=dir_name
-dinstall_infodir=dir_name
-dinstall_libdir=dir_name
-dinstall_mandir=dir_name
-dinstall_mysqlsharedir=dir_name
-dinstall_plugindir=dir_name
-dinstall_sharedir=dir_name
-dinstall_sqlbenchdir=dir_name
-dinstall_supportfilesdir=dir_name
-dodbc_includes=dir_name
-dodbc_lib_dir=dir_name
-dsysconfdir=dir_name
-dtmpdir=dir_name
-dwith_innobase_storage_engine=1
-dwith_archive_storage_engine=1
-dwith_blackhole_storage_engine=1
-dwith_perfschema_storage_engine=1
-dcompilation_comment=string
-ddefault_charset=charset_name
-ddefault_collation=collation_name
-denable_debug_sync=bool
-denable_downloads=bool
-denable_dtrace=bool
-denable_gcov=bool
-denable_gprof=bool
-denabled_local_infile=bool
-denabled_profiling=bool
-dignore_aio_check=bool
-dinnodb_page_atomic_ref_count=bool
-dmysql_maintainer_mode=bool
-doptimizer_trace=bool
-dwith_asan=bool
-dwith_debug=bool
-dwith_editline=value
-dwith_embedded_server=bool
-dwith_embedded_shared_library=bool
-dwith_innodb_memcached=bool
-dwith_libevent=string
-dwith_libedit=bool
-dwith_libwrap=bool
-dmysql_unix_addr=file_name [Config:--socket]
-dmysql_tcp_port=port_num [Config:--port]
-dmysql_datadir=dir_name [Config:--datadir]
-dinstall_scriptdir=dir_name [mysql_install_db]
-dinstall_sbindir=dir_name [Where To install the MYSQLD server]
-dinstall_mysqltestdir=dir_name [Mysql-test]
-dinstall_layout=name [
Standalone:same layout as used for. tar.gz and. zip packages. This is the default.
Rpm:layout similar to RPM packages.
Svr4:solaris Package layout.
Deb:deb Package Layout (experimental).
]
*/


/* Formal Environment:-dwith_debug=0*/

CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/var/lib/mysql \
-DSYSCONFDIR=/ETC \
-dwith_federated_storage_engine=1 \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_perfschema_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dmysql_unix_addr=/var/lib/mysql/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_debug=1


Make
Make install

Cd/usr/local/mysql
#useradd-M-o-r-d/var/lib/mysql-s/bin/bash-c "MySQL Server"-u MySQL
Chown-r Mysql.mysql. /mysql
scripts/mysql_install_db--user=mysql--datadir=/var/lib/mysql
Bin/mysqld_safe--user=mysql &
CP Support-files/mysql.server/etc/init.d/mysqlserver
Kill-9 ' PS aux |grep mysql |awk {' Print $ '} '
/etc/init.d/mysqlserver restart
/usr/local/mysql/bin/mysql_secure_installation
echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile
Source/etc/profile
#./bin/mysqladmin-u root password ' new-password '


#my. CNF should set relevant parameter values with the actual environment [optimization is a gradual process]

# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[Mysqld]
Basedir=/usr/local/mysql
Datadir=/var/lib/mysql
Socket=/var/log/mysqld/mysql.sock
User=mysql
Character-set-server=utf8

back_log=300
innodb_buffer_pool_size=500m
innodb_lock_wait_timeout=120
join_buffer_size=16m
max_connections=5000
max_heap_table_size=100m
max_allowed_packet=4m
query_cache_size=10m
read_rnd_buffer_size=10m
Read_buffer_size=8m
Symbolic-links=0
slave-skip-errors=1062
Sort_buffer_size=8m
long_query_time=10
tmp_table_size=16m
Thread_cache_size=16
Explicit_defaults_for_timestamp=true
Slow_query_log_file=/var/log/mysqld/mysql-slow.log

#server-id=1
#log-bin=binlog
#binlog_format =mixed
#binlog-do-db = db1
#replicate-ignore-table= Db2.table2
#expire_logs_days =7

[Mysqld_safe]
Log-error=/var/log/mysqld/mysqld.log
Pid-file=/var/log/mysqld/mysqld.pid

This article from "wosec" blog, declined reprint!

Centos MySQL 5.6 Installation

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.