Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to Percona tools. I am trying to use pt-table-checksum as follows:

pt-table-checksum h=localhost -u root -p xyz--replicate=percona.checksums --create-replicate-table --databases=mysql

But get the error.

Diffs cannot be detected because no slaves were found

Please read the --recursion-method documentation for information.


#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
init-connect='SET NAMES utf8'
character-set-server = utf8
max_connections = 300




mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user       = multi_admin
password   = user

socket     = /tmp/mysql.sock
port       = 3306
pid-file   = /var/run/mysqld/
datadir    = /spacedb
language   = /usr/share/mysql/english
server-id  = 1
log-bin    = mysql-bin
binlog_format = mixed

# Expire_logs + MaxBinlogSize
expire_logs_days = 7
max_binlog_size = 100M

sync_binlog = 1
innodb_flush_log_at_trx_commit = 1

init-connect='SET NAMES utf8'
character-set-server = utf8
max_connections = 300

socket     = /tmp/mysql.sock2
port       = 3307
pid-file   = /var/run/mysqld/
datadir    = /repdb
language   = /usr/share/mysql/english
server-id  = 2
relay-log  = mysqld2-relay-bin

init-connect='SET NAMES utf8'
character-set-server = utf8

Do I have to use DSN? And how does it work?

share|improve this question

According to the Documentation on --recursion-method

Preferred recursion method for discovering replicas. Possible methods are:

===========  ==================
hosts        SHOW SLAVE HOSTS
dsn=DSN      DSNs from a table

The processlist method is the default, because SHOW SLAVE HOSTS is not reliable. However, the hosts method can work better if the server uses a non-standard port (not 3306). The tool usually does the right thing and finds all replicas, but you may give a preferred method and it will be used first.

The hosts method requires replicas to be configured with report_host, report_port, etc.

The dsn method is special: it specifies a table from which other DSN strings are read. The specified DSN must specify a D and t, or a database-qualified t. The DSN table should have the following structure:

   `id` int(11) NOT NULL AUTO_INCREMENT,  
   `parent_id` int(11) DEFAULT NULL,
   `dsn` varchar(255) NOT NULL,  
   PRIMARY KEY (`id`)

To make the tool monitor only the hosts and for replication lag and checksum differences, insert the values h= and h= into the table. Currently, the DSNs are ordered by id, but id and parent_id are otherwise ignored.

You could do this setup for DSN if you want, but you do not have to go that far yet. Why?

The default --recursion-method is the processlist. This simply means that you did not run START SLAVE; on the port 3307 instance. You cannot use --recursion-method processlist on a Master where all the Slaves are stopped. When you run START SLAVE; on port 3307, a DB Connection should appear in the processlist of the Master (3306 instance) from the Slave (3307 instance). In light of this, you should just run START SLAVE; on port 3307 and then run the pt-table-checksum.

Give it a Try !!!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.