Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda