zoukankan      html  css  js  c++  java
  • 安装MySQL和HandlerSocket

    CentOS 6.5
    MySQL 5.6.33
    HandlerSocket 1.1.2

    # Get packages
    shell> wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33.tar.gz
    shell> wget -O handlerSocket-1.1.2.tar.gz https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL/archive/1.1.2.tar.gz

    ## MySQL
    # System Requirements
    shell> sudo yum install cmake make gcc gcc-c++ perl ncurses-devel bison libtool
    shell> sudo mv /etc/my.cnf /etc/my.cnf.bak (dependes)

    # Preconfiguration setup
    shell> sudo groupadd mysql
    shell> sudo useradd -r -g mysql -s /bin/false mysql

    # Beginning of source-build specific instructions
    shell> tar zxvf mysql-5.6.33.tar.gz
    shell> cd mysql-5.6.33
    shell> cmake .
    shell> make
    shell> sudo make install
    # End of source-build specific instructions

    # Postinstallation setup
    shell> cd /usr/local/mysql
    shell> sudo chown -R mysql:mysql .
    shell> sudo scripts/mysql_install_db --user=mysql
    shell> sudo chown -R root .
    shell> sudo chown -R mysql data
    shell> sudo bin/mysqld_safe --user=mysql &
    # Next command is optional
    shell> sudo cp support-files/mysql.server /etc/init.d/mysqld

    ## HandlerSocket
    # Build Handlersocket
    shell> tar zxvf handlerSocket-1.1.2.tar.gz
    shell> cd HandlerSocket-Plugin-for-MySQL-1.1.2
    shell> ./autogen.sh
    shell> ./configure --with-mysql-source=/home/susl/tools/mysql-5.6.33 --with-mysql-bindir=/usr/local/mysql/bin --with-mysql-plugindir=/usr/local/mysql/lib/plugin
    shell> make
    shell> sudo make install

    # Using Handlersocket
    shell> sudo sh -c "echo '[mysqld]
    loose_handlersocket_port = 9998
    loose_handlersocket_port_wr = 9999
    loose_handlersocket_threads = 16
    loose_handlersocket_threads_wr = 1
    open_files_limit = 65535
    ' >> /usr/local/mysql/my.cnf"
    # Log in to mysql as root
    mysql> install plugin handlersocket soname 'handlersocket.so';

    ----------
    附1:二进制包/源码安装方式的MySQL卸载
    1.关闭MySQL服务进程
    shell> sudo service mysqld stop
    2.查找MySQL的安装目录并彻底删除
    #系统自带的mysql-libs包不要卸载,对应目录不要删掉:/usr/share/mysql, /usr/lib64/mysql
    shell> sudo find / -name mysql
    shell> sudo rm -rf xxx ...
    3.视情况删除配置文件my.cnf
    4.视情况删除MySQL用户以及用户组

    ----------

    附2:配置MySQL的错误日志目录和PID存放目录

    编辑my.cnf,加入以下配置信息:

    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid
  • 相关阅读:
    bzoj 1800 & 洛谷 P2165 [AHOI2009]飞行棋 —— 模拟
    bzoj 1050 [ HAOI 2006 ] 旅行comf —— 并查集
    洛谷P2593 [ ZJOI 2006 ] 超级麻将 —— DP
    bzoj 3029 守卫者的挑战 —— 概率DP
    poj 2288 Islands and Bridges ——状压DP
    bzoj 1029 [ JSOI 2007 ] 建筑抢修 —— 贪心
    bzoj 3743 [ Coci 2015 ] Kamp —— 树形DP
    bzoj 1053 [ HAOI 2007 ] 反素数ant ——暴搜
    【构造共轭函数+矩阵快速幂】HDU 4565 So Easy! (2013 长沙赛区邀请赛)
    构造类斐波那契数列矩阵(矩阵
  • 原文地址:https://www.cnblogs.com/alwu007/p/5916003.html
Copyright © 2011-2022 走看看