Why does the following happen?
$ mysql --version
mysql Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using EditLine wrapper
$ mysql -v
ERROR 1045 (28000): Access denied for user 'xxx'@'localhost' (using password: NO)
I think you are confusing
-v. From the MySQL documentation:
Option names are case sensitive. -v and -V are both legal and have different meanings. (They are the corresponding short forms of the --verbose and --version options.)
I think that when you typed
mysql -v you tried to start MySQL with some sort of verbose flag turned on. Regardless, you did not specify a username or password. So it tried to use your Linux username with no password, which failed.