Cannot Access New Installation of MySQL on an Amazon EC2 Instance I installed MySQL server on an Amazon EC2 instance and started it. Seems like it started, but when I try to do mysql -u root I get this error. 

mysql -u root

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using       password: NO)


I don't have a password for the root and don't know how to go forward. 
How do I access the new installation?
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:

/var/log/mysqld.log


But could also be in this path:

/var/log/mysql/mysqld.log


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.