So, unix root user can connect to mysql root user without password:
root@server $ mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 27 Server version: 5.7.13-0ubuntu0.16.04.2 (Ubuntu)
But unix user redmine can't:
root@server $ sudo -u redmine mysql -uroot ERROR 1698 (28000): Access denied for user 'root'@'localhost'
I guess that mysqld is checking uid=1 over the connecting unix domain socket but I can't see where this is explained in the mysql docs. (strace shows the mysql shell process opening the unix domain socket successfully and closing it after getting a reply from the server)
How do I connect to the database root user without password as a non-root unix user ? (please, spare me the "it's not a good idea" line)