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

381
Views
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 answers
Answer question

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 Report

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 Report
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!