debian mysql 安装慢_debian8安装percona-toolkit检测mysql的索引和慢查询分析

今天打算安装体验:percona-toolkit_3.0.4-1.jessie_amd64.deb  来检测mysql的索引和慢查询分析

但是遇到了缺少:libmysqlclient18和libdbd-mysql-perl的问题

解决方案:

https://packages.debian.org/jessie/amd64/libdbd-mysql-perl/download

https://packages.debian.org/jessie/amd64/libmysqlclient18/download

下载好:通过dpkg -i来安装

A:安装percona-toolkit_3.0.4-1.jessie_amd64.deb

下载地址:https://www.percona.com/doc/percona-repo-config/apt-repo.html

安装:apt-get installpercona-toolkit

文档参考:https://www.percona.com/doc/percona-toolkit/LATEST/index.html

1:遇到的问题:

root@debian45:~# !pt

pt-duplicate-key-checker --port=3306  --password=ops12300.--host=localhost  --user=ops

Cannot connect to MySQL because the Perl DBD::mysql module is not installed or not found.  Run 'perl -MDBD::mysql' to see the directories that Perl searches for DBD::mysql.  If DBD::mysql is not installed, try:

Debian/Ubuntu  apt-get install libdbd-mysql-perl

RHEL/CentOS    yum install perl-DBD-MySQL

OpenSolaris    pgk install pkg:/SUNWapu13dbd-mysql

2:下载libdb-mysql-perl软件包:https://packages.debian.org/jessie/amd64/libdbd-mysql-perl/download

root@debian45:~# dpkg -i libdbd-mysql-perl_4.028-2+deb8u2_amd64.deb

正在选中未选择的软件包 libdbd-mysql-perl。

(正在读取数据库 ... 系统当前共安装有 68528 个文件和目录。)

正准备解包 libdbd-mysql-perl_4.028-2+deb8u2_amd64.deb  ...

正在解包 libdbd-mysql-perl (4.028-2+deb8u2) ...

dpkg: 依赖关系问题使得 libdbd-mysql-perl 的配置工作不能继续:

libdbd-mysql-perl 依赖于 libmysqlclient18 (>= 5.5.24+dfsg-1);然而:

未安装软件包 libmysqlclient18。

dpkg: 处理软件包 libdbd-mysql-perl (--install)时出错:

依赖关系问题 - 仍未被配置

正在处理用于 man-db (2.7.0.2-5) 的触发器 ...

在处理时有错误发生:

libdbd-mysql-perl

3:下载libmysqlclient18软件包:https://packages.debian.org/jessie/amd64/libmysqlclient18/download

4:安装

root@debian45:~# dpkg -i libmysqlclient18_5.5.57-0+deb8u1_amd64.deb

(正在读取数据库 ... 系统当前共安装有 68575 个文件和目录。)

正准备解包 libmysqlclient18_5.5.57-0+deb8u1_amd64.deb  ...

正在将 libmysqlclient18:amd64 (5.5.57-0+deb8u1) 解包到 (5.5.57-0+deb8u1) 上 ...

正在设置 libmysqlclient18:amd64 (5.5.57-0+deb8u1) ...

正在处理用于 libc-bin (2.19-18+deb8u10) 的触发器 ...

root@debian45:~# dpkg -i libdbd-mysql-perl_4.028-2+deb8u2_amd64.deb

(正在读取数据库 ... 系统当前共安装有 68575 个文件和目录。)

正准备解包 libdbd-mysql-perl_4.028-2+deb8u2_amd64.deb  ...

正在将 libdbd-mysql-perl (4.028-2+deb8u2) 解包到 (4.028-2+deb8u2) 上 ...

正在设置 libdbd-mysql-perl (4.028-2+deb8u2) ...

正在处理用于 man-db (2.7.0.2-5) 的触发器 ...

5:测试使用

root@debian45:~# pt-duplicate-key-checker --port=3306  --password=ops12300.  --host=localhost  --user=ops --socket=/tmp/mysql.sock

# A software update is available:

# ########################################################################

# forge.erp_agent_community

# ########################################################################

# agent_community_agent_id_index is a left-prefix of PRIMARY

# Key definitions:

#   KEY `agent_community_agent_id_index` (`agent_id`),

#   PRIMARY KEY (`agent_id`,`community_id`),

# Column types:

# `agent_id` int(10) unsigned not null

# `community_id` int(10) unsigned not null

# To remove this duplicate index, execute:

ALTER TABLE `forge`.`erp_agent_community` DROP INDEX `agent_community_agent_id_index`;

# ########################################################################

# forge.erp_agent_ridgepole

# ########################################################################

# agent_ridgepole_agent_id_index is a left-prefix of PRIMARY

# Key definitions:

#   KEY `agent_ridgepole_agent_id_index` (`agent_id`),

#   PRIMARY KEY (`agent_id`,`ridgepole_id`),

# Column types:

# `agent_id` int(10) unsigned not null

# `ridgepole_id` int(10) unsigned not null

# To remove this duplicate index, execute:

ALTER TABLE `forge`.`erp_agent_ridgepole` DROP INDEX `agent_ridgepole_agent_id_index`;

# ########################################################################

# forge.erp_city_head_office

# ########################################################################

# city_head_office_city_id_index is a left-prefix of PRIMARY

# Key definitions:

#   KEY `city_head_office_city_id_index` (`city_id`),

#   PRIMARY KEY (`city_id`,`head_office_id`),

# Column types:

# `city_id` int(10) unsigned not null

# `head_office_id` int(10) unsigned not null

# To remove this duplicate index, execute:

ALTER TABLE `forge`.`erp_city_head_office` DROP INDEX `city_head_office_city_id_index`;

# ########################################################################

# forge.erp_comments

# ########################################################################

# comments_trace_id_index is a left-prefix of acceptor_type

# Key definitions:

#   KEY `comments_trace_id_index` (`trace_id`),

#   KEY `acceptor_type` (`trace_id`,`acceptor_type`) USING BTREE

# Column types:

# `trace_id` int(11) not null

# `acceptor_type` varchar(255) collate utf8_unicode_ci not null

# To remove this duplicate index, execute:

ALTER TABLE `forge`.`erp_comments` DROP INDEX `comments_trace_id_index`;

# ########################################################################

# forge.erp_community_education

# ########################################################################

# community_education_community_id_index is a left-prefix of PRIMARY

# Key definitions:

#   KEY `community_education_community_id_index` (`community_id`),

#   PRIMARY KEY (`community_id`,`education_id`),

# Column types:

# `community_id` int(10) unsigned not null

# `education_id` int(10) unsigned not null

# To remove this duplicate index, execute:

ALTER TABLE `forge`.`erp_community_education` DROP INDEX `community_education_community_id_index`;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值