日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ubuntu11.10安装mysql+handlersocket

發布時間:2024/1/17 数据库 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu11.10安装mysql+handlersocket 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.安裝mysql:(不管要啥,一股腦都裝上)

sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo apt-get install libmysqlclient-devsudo apt-get install libmysqld-dev

?

2.下載mysql和handlersocket源代碼:

mysql-5.1.62.tar.gz? 可以自己百度

ahiguti-HandlerSocket-Plugin-for-MySQL-1.1.0-2-g395fa55.tar.gz? 這個都不好下,在實驗室才下到。。

3.解壓

sudo tar -zxvf mysql-5.1.62.tar.gz -C /usr/local/src/sudo tar -zxvf handlersocket_1.0.6-80-g88bf1e0.orig.tar.gz -C /usr/local/src/

?

4.編譯安裝handler socket

cd /usr/local/src/ahiguti-HandlerSocket-Plugin-for-MySQL-395fa55/sudo ./autogen.sh

?

小插曲:

這里出現:

錯誤1

Searching libtoolize... -e WARNING: Cannot Found libtoolize... input libtool command ^C

解決:

sudo apt-get install libtool

?

錯誤2

Searching libtoolize... -e FOUND: libtoolize -> libtoolize Searching aclocal... -e WARNING: Cannot Found aclocal... input aclocal command ^C

解決:

sudo apt-get install autotools-devsudo apt-get install automake

?

插曲結束~

sudo ./configure --with-mysql-source=../mysql-5.1.62 --with-mysql-bindir=/usr/bin --with-mysql-plugindir=/usr/lib/mysql/plugin


with-mysql-source 表示MySQL源代碼目錄,with-mysql-bindir 表示MySQL二進制可執行文件目錄(也就是 mysql_config 所在目錄,可以用whereis mysql_config找到),with-mysql-plugindir 表示MySQL插件目錄?
如果不清楚這個目錄在哪,可以按如下方法查詢:?
mysql> SHOW VARIABLES LIKE 'plugin%';?
+---------------+-----------------------+?
| Variable_name | Value? ?? ?? ?? ?? ???|?
+---------------+-----------------------+?
| plugin_dir? ? | /usr/lib/mysql/plugin |?
+---------------+-----------------------+?

sudo make & make install

?

5.修改mysql配置文件my.cnf,添加相關端口配置:

# sudo vi /etc/my.cnf [mysqld] loose_handlersocket_port = 9998 # the port number to bind to (for read requests) loose_handlersocket_port_wr = 9999 # the port number to bind to (for write requests) loose_handlersocket_threads = 16 # the number of worker threads (for read requests) loose_handlersocket_threads_wr = 1 # the number of worker threads (for write requests) open_files_limit = 65535 # to allow handlersocket accept many concurren connections, make open_files_limit as large as possible.

6.登陸mysql

bobo@master:/usr/local/src$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 45 Server version: 5.1.62-0ubuntu0.11.10.1 (Ubuntu)Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> install plugin handlersocket soname 'handlersocket.so'; Query OK, 0 rows affected (0.30 sec)

插曲二:

中間又出現錯誤了。。

mysql> install plugin handlersocket soname 'handlersocket.so'; ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/handlersocket.so' (errno: 2 cannot open shared object file: No such file or directory)

莫名其妙的,結果我又單獨make一下,再make install一下,就好了。。

我也不知道跟這個又沒有關系。。。

插曲二終

通過show processlist 能在MySQL里看到HandlerSocket的線程了:

mysql> show processlist -> ; +----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+ | 45 | root | localhost | NULL | Query | 0 | NULL | show processlist | | 46 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 47 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 48 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 49 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 50 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 51 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 52 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 53 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 54 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 55 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 56 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 57 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 58 | system user | connecting host | handlersocket | Connect | NULL | handlersocket: mode=wr, 0 conns, 0 active | NULL | | 59 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 60 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 61 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 62 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | +----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+ 18 rows in set (0.00 sec)

也可以查看端口占用來驗證你的mysql裝好了:

bobo@master:~$ sudo lsof -i :9998 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 14173 mysql 30u IPv4 49030 0t0 TCP *:9998 (LISTEN) bobo@master:~$ sudo lsof -i :9999 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 14173 mysql 77u IPv4 49032 0t0 TCP *:9999 (LISTEN)

?

7.簡單測試

參考http://lsddesign.blog.163.com/blog/static/170908080201231895758377/

?

?

看了許多教程,有許多問題,覺得這個的參考價值大一些:

http://leishguolearn.googlecode.com/svn-history/r296/trunk/learn_doc/final_shguo/handlersocket

轉載于:https://www.cnblogs.com/aaronwxb/archive/2012/04/29/2475834.html

總結

以上是生活随笔為你收集整理的ubuntu11.10安装mysql+handlersocket的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。