Bug #72572 mysqluserclone does not give informative error message when MySQL is stopped
Submitted: 8 May 2014 12:20 Modified: 12 Jun 2014 2:41
Reporter: Shahriyar Rzayev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Utilities Severity:S1 (Critical)
Version:1.4.2 OS:Linux (CentOS 6.5)
Assigned to: CPU Architecture:Any

[8 May 2014 12:20] Shahriyar Rzayev
Description:
For first time using mysqluserclone:

[root@linuxsrv3 ~]# mysqluserclone --source='root:12345@localhost' --dump
Usage: mysqluserclone --source=user:pass@host:port:socket --destination=user:pass@host:port:socket joe@localhost sam:secret1@localhost

mysqluserclone: error: No arguments found. Use --help for available options.

It says that error: No arguments found.
Yes i agree i have to supply user name to --dump option but in fact MySQL does not started:

[root@linuxsrv3 ~]# service mysqld status
mysqld is stopped

Only After writing all options correctly it rises ERROR:

[root@linuxsrv3 ~]# mysqluserclone --source='root:12345@localhost' --dump 'repl'@'%'
# Source on localhost: ... ERROR: Cannot connect to the Source server.
Error Can't connect to MySQL server on 'localhost:3306' (111 Connection refused)

So first off all if my syntax is not correct and if MySQL does not started i think,it must print "There is no running instance of MySQL." or something like.

Related to second usage: 111 Connection refused --- this error is confusing because we see this error under other conditions.

So, all over world all people :) know this error message when mysql is stopped:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

It will be more informative :)

How to repeat:
Use "mysqluserclone --source='root:12345@localhost' --dump" when MySQL is stopped.

Suggested fix:
Giving more informative error messages.
[9 May 2014 8:36] MySQL Verification Team
Hello Shahriyar,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[15 May 2014 10:48] Shahriyar Rzayev
Also related to remote host:
When using mysqluserclone with following syntax, If on destination host iptables enabled:

[root@linuxsrv3 ~]# mysqluserclone --source=root:12345@localhost --destination=remote:12345@192.168.1.88 'remote'@'%' ttt:12345@localhost --force
# Source on localhost: ... connected.
# Destination on 192.168.1.88: ... ERROR: Cannot connect to the Destination server.
Error Can't connect to MySQL server on '192.168.1.88:3306' (113 No route to host)

##. (113 No route to host)

Is on destination host iptables disabled  and mysql stopped:

[root@linuxsrv4 ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@linuxsrv4 ~]# service mysqld stop
Stopping mysqld:                                           [  OK  ]

[root@linuxsrv3 ~]# mysqluserclone --source=root:12345@localhost --destination=remote:12345@192.168.1.88 'remote'@'%' ttt:12345@localhost --force
# Source on localhost: ... connected.
# Destination on 192.168.1.88: ... ERROR: Cannot connect to the Destination server.
Error Can't connect to MySQL server on '192.168.1.88:3306' (111 Connection refused)

## (111 Connection refused)
[12 Jun 2014 2:41] Philip Olson
Fixed as of the upcoming MySQL Utilities 1.4.4 release, and here's the changelog entry:

Error messages for the "mysqluserclone" utility were improved by making
them more explicit in terms of what might be missing.

Thank you for the bug report.