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

395
Vistas
Django (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

I have come accross a strange issue, I have deployed a django site to an Ubuntu 20.04 LTS server. The problem is my django app can not connect to the database because It is doesn't using the db connection credentials that have identified in app settings.py. It is using root with no password. But when I can run manage.py db operations without any problem.

This is my settings.py

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'pplus_db',
        'USER': 'pplus_user',
        'PASSWORD': 'dfa@4GL-5qQU',
        'HOST': 'localhost', 
        'PORT':'3306',
    }
}

The Error:

OperationalError at /accounts/login/
(1045, "Access denied for user 'root'@'localhost' (using password: NO)")
Request Method: POST
Request URL:    http://IP_ADDRESS/accounts/login/
Django Version: 3.2.5
Exception Type: OperationalError
Exception Value:    
(1045, "Access denied for user 'root'@'localhost' (using password: NO)")
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I have managed to solve the problem, I think the issue was in cashing. After follow this solution django.db.utils.OperationalError: (1045:Access denied for user 'root'@'localhost' (using password: NO)

Make sure to restart your services:
sudo systemctl daemon-reload
sudo systemctl restart gunicorn
Or if you can restart the server.

over 4 years ago · Santiago Trujillo Denunciar

0

you just need to run sudo mysqld_safe --skip-grant-tables

or reset your MySQL password to null

over 4 years ago · Santiago Trujillo Denunciar
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