Bug #766 Password of the user used by slave to connect to master must be <=16 characters
Submitted: 30 Jun 2003 11:32 Modified: 30 Jun 2007 0:44
Reporter: Guilhem Bichot Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0 OS:Any (all)
Assigned to: Chuck Bell CPU Architecture:Any

[30 Jun 2003 11:32] Guilhem Bichot
Description:
Otherwise, the slave can't connect.
This is because the slave, when it reads a password (from my.cnf or CHANGE MASTER or master.info) keeps only the first 16 characters.

How to repeat:
MASTER> grant all on *.* to gb@localhost identified by '1234567890abcdefghij';

SLAVE> change master to master_log_file='gbichot2-bin.005',master_log_pos=4,master_user='gb',master_password='1234567890abcdefghij';

SLAVE> start slave;

030630 20:13:29  Slave I/O thread: error connecting to master 'gb@localhost:3306': Error: 'Access denied for user: 'gb@localhost' (Using password: YES)'  errno: 1045  retry-time: 3  retries: 86400

Even though
[guilhem@gbichot2 1]$ mysql -ugb -p1234567890abcdefghij
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 119 to server version: 4.0.14-debug-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

And in master.info we see:
gbichot2-bin.005
4
localhost
gb
1234567890abcdefg
3306
3
(password is truncated).
Even rpl000017-slave.sh states it clearly:
cat > $MYSQL_TEST_DIR/var/slave-data/master.info <<EOF
master-bin.001
4
127.0.0.1
replicate
aaaaaaaaaaaaaaabthispartofthepasswordisnotused
<cut>

Suggested fix:
This was initially suspected by Konstantin, so I'll talk with him about the solutions.
[3 Jul 2003 16:05] Michael Widenius
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

I have extended the replication password to 32 characters in 4.0.14
We will document this (and the other replications) limits in the MySQL manual.
[22 Aug 2006 11:57] Geert Vanderkelen
There is a situation where the password is still truncated to 16 characters when it's bigger. It happens when restarting the slave.

Using 4.0.25:
- Setup replication on the master, but use a password for the user which is 17 characters long, like 'replication_slave' for example.
- Setup the slave using CHANGE MASTER TO with the long password, and make sure the --skip-slave-start is set
- Check whether replication works: it should work and the master.info should contain the correct password: 'replication_slave'

Now, here is the problem:
- Shutdown the slave MySQL server: master.info is still OK, correct password
- Start the slave MySQL server: master.info is NOK, wrong password truncated to 'replication_slav' or 16 chars.

This has been reported on 4.0.18, but I verified it with 4.0.25. The latest 4.1 and 5.0 don't have the problem.

Maybe this is a bit late to fix, but never the less reporting and re-opening for documenting it at least.
[29 Aug 2006 19:40] Guilhem Bichot
I was involved in fixing this in July 2003; now it is re-opened, but it needs a new assignee.
[30 Jun 2007 0:44] Trudy Pelzer
Per Geert, "the latest 4.1 and 5.0 don't have the problem."
Since bug doesn't exist in current versions of MySQL, setting
this to won't fix (in 4.0, which is in extended maintenance).