How to set a non-empty password to the `root` MySQL user in Ubuntu?

See also: How to fix non-root login to MySQL in Ubuntu?