Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda