• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

336
Views
geodjango with mysql getting error django.db.utils.OperationalError: (1045, "Access denied for user

seetings.py

DATABASES = {
'default': {
    'ENGINE':'django.db.backends.mysql','django.contrib.gis.db.backends.mysql'
    'OPTIONS': {
        'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
    },
 },

}

without 'django.contrib.gis.db.backends.mysql' the code is working fine but since i want to use django geolocation using mysql, i added this (if I don't add I get

'databaseoperations' object has no attribute 'geo_db_type'

error), and now I am getting

django.db.utils.OperationalError: (1045, "Access denied for user ---" error although the user has full privileges.

Please help I am new to django

Thank you

about 3 years ago · Santiago Trujillo
1 answers
Answer question

0

It seems like you try to set multiple database backends in your settings but you need just one: django.contrib.gis.db.backends.mysql works for both spatial and non-spatial use cases.

So your settings.py should probably look something like this:

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.mysql',
        'OPTIONS': {
            'read_default_file': os.path.join(PROJECT_ROOT,"my.cnf"),
        },
    },
}
about 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error