安裝MySQL和HandlerSocket

來源:互聯網
上載者:User

標籤:

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 https://github.com/DeNA/HandlerSocket-Plugin-for-MySQL/archive/1.1.2.tar.gz
shell> mv 1.1.2.tar.gz handlerSocket-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‘;

----------
附:二進位包/源碼安裝方式的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使用者以及使用者組

安裝MySQL和HandlerSocket

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.