Chinaunix首页 | 论坛 | 博客

OPS

  • 博客访问: 485431
  • 博文数量: 117
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1210
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-05 14:50
个人简介

hellow 运维

文章分类

全部博文(117)

文章存档

2019年(1)

2018年(1)

2017年(45)

2016年(38)

2015年(32)

我的朋友

分类: 系统运维

2017-10-16 11:00:33

今天打算安装体验:percona-toolkit_3.0.4-1.jessie_amd64.deb  来检测mysql的索引和慢查询分析
但是遇到了缺少:libmysqlclient18和libdbd-mysql-perl的问题
解决方案:
 
 
下载好:通过dpkg -i来安装
A:安装percona-toolkit_3.0.4-1.jessie_amd64.deb
 下载地址:
  安装:apt-get install percona-toolkit

 文档参考:
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软件包:  

   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软件包:  
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`;

阅读(1123) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~