$ sudo mysql -u root # I had to use "sudo" since is new installation
mysql> USE mysql;
mysql> CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY ''; # replace YOUR_SYSTEM_USER with your username
mysql> GRANT ALL PRIVILEGES ON *.* TO 'YOUR_SYSTEM_USER'@'localhost'; # replace YOUR_SYSTEM_USER with your username
mysql> UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER'; # replace YOUR_SYSTEM_USER with your username
mysql> FLUSH PRIVILEGES;
# this is the password you need to add to in congfig/database.yml
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
mysql> exit;
If you set the password and forgot to write it down, you can enter mysql without root passwork like this:
$ sudo /usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf
$ service mysql restart