While others are suggesting a full reset of the MySQL
root password via launching into single user mode and then reseting the password manually through a query, that should not be the case on a clean install.
And though this question is from 2015, it’s unclear what version of MySQL is being used. So that said, using MySQL 5.7, the process of getting a password on a clean install has changed. A temporary password is now set in the MySQL daemon log file which should be in this location:
But could also be in this path:
As explained here in the official MySQL 5.7 docs the password is in that error log and can be found using Grep like this:
grep 'temporary password' /var/log/mysqld.log
You can now login to MySQL using that password by running this command and entering that password when prompted:
mysql -uroot p
Or you can run
mysql_secure_installation—which is good practice regardless—and enter and change the password there with that.