Bug 180624

Summary: databases/mysql55-server: mysql_upgrade man, and upgrade/install info missing mandatory information
Product: Ports & Packages Reporter: Chris H <bsd-lists>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Chris H 2013-07-18 05:10:00 UTC
I recently performed an upgrade/update, which required upgrading mysql-server from
mysql-server-5.5.30 --> mysql-server-5.5.32. At the end of the process, the message
indicated it was necessary to perform mysql_ugrade(1). Doing so, led to the following:
mysql_upgrade -u root --verbose
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed

_extremely_ informative -- no?
So what to do? A quick check of the server, and the databases indicate all appear to
normal. Conclusion; dismiss the mysql_upgrade(1) as being broken, and forget about it.
The man(1) pages reveal nothing pertinent, in fact they are essentially the same page
as: http://dev.mysql.com/doc/refman/5.5/en/mysql-upgrade.html
with one _major_ exception; the user comments at the end. In particular; the one at
the end:
mysql_upgrade -u root -p

The -p makes all the difference. But unlike:
mysql -u root add
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
The omission of the -p does _not_ provide an informative error, as mysql, and all
of it's other utilities _do_.
Please make references to this in both the mysql_upgrade(1) man(1) page && the
install/upgrade message emitted at the end of the install/upgrade.
Additional reference: http://forums.freebsd.org/showthread.php?t=40884

Thank you for all your time, and consideration.

Fix: 

print a message after the upgrade has finished, indicating that the options
-u root -p
MUST be used when executing mysql_upgrade.
This information should also be included within the man page(s).
How-To-Repeat: Attempt to upgrade mysql-server, or upgrade mysql-client 5.5
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-07-18 09:35:38 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 roger.larsson 2014-01-08 18:35:24 UTC
If the database is a Akonadi (KDE) database the above won't be 
enough. You need to mirror the options given to your mysqld, check 
with 
ps aux | grep mysql 
Copy the options to the mysql_upgrade commands (I did not need '-u 
root -p' but you might) 
mysql_upgrade --defaults-
file=/home/USER/.local/share/akonadi/mysql.conf --
datadir=/home/USER/.local/share/akonadi/db_data/ --
socket=/tmp/akonadi-USER.x0Bvxr/mysql.socket 
I really think the --socket option is the key. 

/RogerL
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2014-02-11 13:49:54 UTC
State Changed
From-To: open->closed

Please open a bug report at mysql.com if you like, not a port issue.