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

394
Vistas
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

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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"),
        },
    },
}
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