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'.