当前位置:Gxlcms > 数据库问题 > debian8安装percona-toolkit检测mysql的索引和慢查询分析

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

时间:2021-07-01 10:21:17 帮助过:9人阅读


但是遇到了缺少: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 install percona-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`;


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

标签:package   .so   ace   size   solaris   varchar   def   deb   ons   

人气教程排行