Bug #39512 mysql_upgrade_shell cannot handle --socket option properly.
Submitted: 18 Sep 2008 8:45 Modified: 29 Sep 2008 18:51
Reporter: Meiji KIMURA Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0 OS:Linux
Assigned to: CPU Architecture:Any

[18 Sep 2008 8:45] Meiji KIMURA
Description:
mysql_upgrade can handle --socket option properly, but mysql_upgrade_shell cannot handle. Because mysql_upgrade_shell adds an escape character \ to each /.

How to repeat:
Specify --socket optio nto mysql_upgrade_shell. mysql_upgrade_shell adds \ to eache / of path, then it causes the error in mysqlcheck and mysql. In this case, 
'/tmp/mysql50/mysql.sock' become '\/tmp\/mysql50\/mysql.sock'

[root]# mysql_upgrade_shell --force --verbose --password=root --socket=/tmp/mysql50/mysql.sock
Running /usr/local/mysql/bin/mysqlcheck --password=root --socket=\/tmp\/mysql50\/mysql.sock --check-upgrade --all-databases --auto-repair --user=root
/usr/local/mysql/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '\/tmp\/mysql50\/mysql.sock' (2) when trying to connect
This script updates all the mysql privilege tables to be usable by
the current version of MySQL

Suggested fix:
mysql_upgrade_shell have to deal with '--socket' as the same manner for '--basedir' and '--datadir'.
[18 Sep 2008 8:49] Meiji KIMURA
[Workaround] Use mysql_upgrade instead of mysql_upgrade_shell.