请先关注 [低调大师] 公众号 优秀的自媒体个人博客,低调大师,许军

低调大师

您现在的位置是:首页>文章详情

文章详情

CentOS6.5下编译安装MySQL5.6

2017-09-28 103热度

1.解决依赖

 yum install gcc gcc-c++ ncurses-devel perl 

2.安装cmake

mysql5.6以后都需
彩钢瓦
彩钢夹芯板要cmake编译.

 cd /usr/local/src wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz tar -xzvf cmake-2.8.10.2.tar.gz cd cmake-2.8.10.2 ./bootstrap make && make install 

3.设置mysql用户组和目录

 groupadd mysql useradd -r -g mysql mysql mkdir -p /server/mysql5.6 mkdir -p /data/mysql/datadbase

4.下载&&安装

 cd /usr/local/src/ wget https://downloads.mysql.com/archives/get/file/mysql-5.6.23.tar.gz tar xvf mysql-5.6.23.tar.gz cd mysql-5.6.23 cmake \ -DCMAKE_INSTALL_PREFIX=/server/mysql5.6 \ -DMYSQL_UNIX_ADDR=/server/mysql5.6/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DMYSQL_DATADIR=/data/mysql/database \ -DMYSQL_TCP_PORT=3306 \ -DENABLE_DOWNLOADS=1  make && make install

如安装过程遇到失败,删除CMakeCache.txt文件后,重新编译。

5.修改mysql目录权限

 chown -R mysql:mysql /server/mysql5.6/ chown -R mysql:mysql /data/mysql/database/

6.mysql初始化

 cd /server/mysql5.6/ scripts/mysql_install_db --user=mysql --datadir=/data/mysql/database

7.mysql配置文件

 cp /server/mysql5.6/support-files/my-default.cnf /etc/my.cnf  vim /etc/my.cnf [mysqld] basedir = /server/mysql5.6/ datadir = /data/mysql/database port = 3306 server_id = 1001 socket = /data/mysql/database/mysql.sock pid-file = /data/mysql/database/mysql.pid log-bin = /server/mysql5.6/binlog/mysql-bin skip-name-resolve binlog_format = mixed binlog_cache_size = 2M max_allowed_packet = 64M back_log = 200 max_connections = 1000 max_connect_errors = 50000 open_files_limit = 65535 wait_timeout = 900 interactive_timeout = 900 table_open_cache = 2048 thread_stack = 192K thread_cache_size = 128 table_definition_cache = 4096 query_cache_type = 0 query_cache_size = 0 tmp_table_size = 128M max_heap_table_size = 128M key_buffer_size = 16M sort_buffer_size = 2M read_buffer_size = 2M join_buffer_size = 2M read_rnd_buffer_size = 8M bulk_insert_buffer_size = 32M myisam_sort_buffer_size = 63M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 innodb_file_format = Barracuda innodb_read_io_threads = 8 innodb_write_io_threads = 8 innodb_buffer_pool_size = 48000M innodb_thread_concurrency = 0 innodb_flush_log_at_trx_commit = 0 sync_binlog = 0 innodb_log_file_size = 500M innodb_log_buffer_size = 32M innodb_max_dirty_pages_pct = 50 innodb_lock_wait_timeout = 30 innodb_flush_method = O_DIRECT innodb_buffer_pool_instances = 16 innodb_change_buffering = all innodb_adaptive_flushing = 1 innodb_io_capacity = 4000 sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

8.添加开机启动

 cp /server/mysql5.6/support-files/mysql.server /etc/init.d/mysqld chkconfig --level 35 mysqld on
收藏 (0)

相关文章

    文章评论

    共有0条评论来说两句吧...