{question}
How can I connect Django to SingleStore DB?
{question}
{answer}
When you connect from the latest version of Django to SingleStore DB, you might receive the following error message:
django.db.utils.OperationalError: (2012, 'Error in server handshake')
To connect to SingleStore DB, you will need to configure the auth_plugin in the OPTIONS field.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '{HOST}',
'NAME': '{DBNAME}',
'USER': '{USERNAME}',
'PASSWORD' : '{PASSWORD}',
'PORT': '3306',
'OPTIONS': {
'auth_plugin': 'mysql_native_password'
}
}
}
{answer}