If you installed MySQL without a root password, you will have difficulties to login as root. For example, you need to sudo first, and can’t login as a regular user. The solution to this problem is to create a new root-like user like so:
To allow this new user to login from another host, repeat the 2
commands above, replacing
%. Please note that this
is not recommended for security reasons.