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

CentOS6.5下编译安装MySQL5.6

日期:2017-09-28点击:983

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
原文链接:https://www.centoschina.cn/server/sql/mysql/8993.html
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

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

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章