Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
MySQL Access denied for user 'root'@'localhost' error

I just installed MySQL 5.7 on CentOS 7 and root password is configured.

MySQL login on my localhost is successful as below.

[root@test]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 34
Server version: 5.7.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

However, a web application that I need to connect to MySQL says as below.

Access denied for user 'root'@'localhost' (using password: NO)
The database connection failed: the host or super user parameters must be wrong.

mysqld.log says

2020-06-26T05:31:47.878390Z 27 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2020-06-26T05:36:12.328126Z 28 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2020-06-26T05:53:18.872033Z 29 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2020-06-26T05:53:35.232340Z 30 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2020-06-26T06:06:34.293625Z 35 [Note] Access denied for user 'root'@'localhost' (using password: NO)

The password is correct and it is fresh installed MySQL. I tried mysqld_safe --skip-grant-tables to remove my password and it works without password but sql scripts cannot run. Thus, password configuration is required for security purposes.

phpmyadmin is accessible with the same MySQL ID and PW.

Will it be the web application problem?(but I doubt it because it is an initial setup stage) or there is something that I can do on the MySQL side?

Thanks,

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!