Question

MySQL 5.7.7 - Centos 7 el7 - Access denied

  • Posted April 18, 2015
  • MySQL

Centos 7 3.10.0-123.8.1.el7.x86_64

Hi i have installed MySQL 5.7.7 from MySQL Yum Repository

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

After service mysqld start i use mysql_secure_installation then i get prompted for a password i just press enter and i get this error:

Error: Access denied for user ‘root’@‘localhost’ (using password: NO)

I think i have tried everything to find the password or to reset it - but no go

here are my steps:

  1. rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
  2. nano /etc/yum.repos.d/mysql-community.repo
  3. Set MySQL 5.6 enabled=0 and set MySQL 5.7 enabled=1
  4. yum install mysql-community-server
  5. service mysqld start
  6. mysql_secure_installation

Error: Access denied for user ‘root’@‘localhost’ (using password: NO)

any help is appreciated.

Subscribe
Share

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

MySQL v 5.7 or higher generates a temporary random password after installation and stored that in mysql error log file, located at /var/log/mysqld.log for an installation by the MySQL Yum repository on CentOS 7.

use below command to see the password: shell > sudo grep ‘temporary password’ /var/log/mysqld.log

@sameershah29 Thanks a lot for this solution. This is an old post but it helped me even today!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I know this is old and you probably figured it out by now, but this is the first link that comes up when I searched for it and I want others to find solution.

A temporary, random root password is generated and stored in the error log, which is /var/log/mysqld.log for an installation by the MySQL Yum repository. You can use this command to see the password:

shell > sudo grep 'temporary password' /var/log/mysqld.log

(Source https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html)

For me the password generated after actually starting mysql server.

I know this is old and you probably figured it out by now, but this is the first link that comes up when I searched for it and I want others to find solution.

A temporary, random root password is generated and stored in the error log, which is /var/log/mysqld.log for an installation by the MySQL Yum repository. You can use this command to see the password:

shell > sudo grep 'temporary password' /var/log/mysqld.log

(Source https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html)

For me the password generated after actually starting mysql server.

Hi sameershah29, I created this account just to thank you!