Django mysqlclient backend produces django.db.utils.OperationalError: (2059, ) in Windows











up vote
0
down vote

favorite












I'm trying to get my Django project running on a Windows 10 computer and it throws a very unspecific error when trying to establish a database connection.
In this SO-post the problem was with the authentication, but in that post details about the error is displayed instead of <NULL> which gives very little to go on.



The entire error looks like this:



Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000018C3B8761E0>
Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, <NULL>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementcommandsrunserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksregistry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksmodel_checks.py", line 27, in check_all_models
errors.extend(model.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1200, in check
errors.extend(cls._check_fields(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1272, in _check_fields
errors.extend(field.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 894, in check
errors = super().check(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 206, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 303, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasevalidation.py", line 21, in check_field
field_type = field.db_type(self.connection)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 648, in db_type
return connection.data_types[self.get_internal_type()] % data
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 133, in data_types
if self.features.supports_microsecond_precision:
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlfeatures.py", line 65, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 345, in mysql_version
with self.temporary_connection() as cursor:
File "C:UsersmarcuAppDataLocalProgramsPythonPython36libcontextlib.py", line 81, in __enter__
return next(self.gen)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 576, in temporary_connection
cursor = self.cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 255, in cursor
return self._cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 232, in _cursor
self.ensure_connection()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbutils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2059, <NULL>)


Using python 3.6.6 and mysqlclient 1.3.13, although 1.3.12 has also been tried.



Database settings:



DATABASES = {
'default': {
'ENGINE': "django.db.backends.mysql", # 'mysql.connector.django'
'NAME': 'testdb',
'USER': 'root',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'autocommit': True,
},
},
}









share|improve this question
























  • Please post your database settings in Django.
    – Sachin Kukreja
    Aug 20 at 7:46












  • @SachinKukreja Added to post!
    – Marcus Grass
    Aug 20 at 7:55










  • Are you able to authenticate into the mysql client (without using Django)?
    – Sachin Kukreja
    Aug 20 at 8:17












  • @SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
    – Marcus Grass
    Aug 20 at 8:20

















up vote
0
down vote

favorite












I'm trying to get my Django project running on a Windows 10 computer and it throws a very unspecific error when trying to establish a database connection.
In this SO-post the problem was with the authentication, but in that post details about the error is displayed instead of <NULL> which gives very little to go on.



The entire error looks like this:



Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000018C3B8761E0>
Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, <NULL>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementcommandsrunserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksregistry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksmodel_checks.py", line 27, in check_all_models
errors.extend(model.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1200, in check
errors.extend(cls._check_fields(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1272, in _check_fields
errors.extend(field.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 894, in check
errors = super().check(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 206, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 303, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasevalidation.py", line 21, in check_field
field_type = field.db_type(self.connection)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 648, in db_type
return connection.data_types[self.get_internal_type()] % data
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 133, in data_types
if self.features.supports_microsecond_precision:
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlfeatures.py", line 65, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 345, in mysql_version
with self.temporary_connection() as cursor:
File "C:UsersmarcuAppDataLocalProgramsPythonPython36libcontextlib.py", line 81, in __enter__
return next(self.gen)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 576, in temporary_connection
cursor = self.cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 255, in cursor
return self._cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 232, in _cursor
self.ensure_connection()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbutils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2059, <NULL>)


Using python 3.6.6 and mysqlclient 1.3.13, although 1.3.12 has also been tried.



Database settings:



DATABASES = {
'default': {
'ENGINE': "django.db.backends.mysql", # 'mysql.connector.django'
'NAME': 'testdb',
'USER': 'root',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'autocommit': True,
},
},
}









share|improve this question
























  • Please post your database settings in Django.
    – Sachin Kukreja
    Aug 20 at 7:46












  • @SachinKukreja Added to post!
    – Marcus Grass
    Aug 20 at 7:55










  • Are you able to authenticate into the mysql client (without using Django)?
    – Sachin Kukreja
    Aug 20 at 8:17












  • @SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
    – Marcus Grass
    Aug 20 at 8:20















up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to get my Django project running on a Windows 10 computer and it throws a very unspecific error when trying to establish a database connection.
In this SO-post the problem was with the authentication, but in that post details about the error is displayed instead of <NULL> which gives very little to go on.



The entire error looks like this:



Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000018C3B8761E0>
Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, <NULL>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementcommandsrunserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksregistry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksmodel_checks.py", line 27, in check_all_models
errors.extend(model.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1200, in check
errors.extend(cls._check_fields(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1272, in _check_fields
errors.extend(field.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 894, in check
errors = super().check(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 206, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 303, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasevalidation.py", line 21, in check_field
field_type = field.db_type(self.connection)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 648, in db_type
return connection.data_types[self.get_internal_type()] % data
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 133, in data_types
if self.features.supports_microsecond_precision:
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlfeatures.py", line 65, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 345, in mysql_version
with self.temporary_connection() as cursor:
File "C:UsersmarcuAppDataLocalProgramsPythonPython36libcontextlib.py", line 81, in __enter__
return next(self.gen)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 576, in temporary_connection
cursor = self.cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 255, in cursor
return self._cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 232, in _cursor
self.ensure_connection()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbutils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2059, <NULL>)


Using python 3.6.6 and mysqlclient 1.3.13, although 1.3.12 has also been tried.



Database settings:



DATABASES = {
'default': {
'ENGINE': "django.db.backends.mysql", # 'mysql.connector.django'
'NAME': 'testdb',
'USER': 'root',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'autocommit': True,
},
},
}









share|improve this question















I'm trying to get my Django project running on a Windows 10 computer and it throws a very unspecific error when trying to establish a database connection.
In this SO-post the problem was with the authentication, but in that post details about the error is displayed instead of <NULL> which gives very little to go on.



The entire error looks like this:



Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0000018C3B8761E0>
Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2059, <NULL>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementcommandsrunserver.py", line 120, in inner_run
self.check(display_num_errors=True)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 364, in check
include_deployment_checks=include_deployment_checks,
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocoremanagementbase.py", line 351, in _run_checks
return checks.run_checks(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksregistry.py", line 73, in run_checks
new_errors = check(app_configs=app_configs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangocorechecksmodel_checks.py", line 27, in check_all_models
errors.extend(model.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1200, in check
errors.extend(cls._check_fields(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsbase.py", line 1272, in _check_fields
errors.extend(field.check(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 894, in check
errors = super().check(**kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 206, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 303, in _check_backend_specific_checks
return connections[db].validation.check_field(self, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasevalidation.py", line 21, in check_field
field_type = field.db_type(self.connection)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbmodelsfields__init__.py", line 648, in db_type
return connection.data_types[self.get_internal_type()] % data
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 133, in data_types
if self.features.supports_microsecond_precision:
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlfeatures.py", line 65, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangoutilsfunctional.py", line 36, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 345, in mysql_version
with self.temporary_connection() as cursor:
File "C:UsersmarcuAppDataLocalProgramsPythonPython36libcontextlib.py", line 81, in __enter__
return next(self.gen)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 576, in temporary_connection
cursor = self.cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 255, in cursor
return self._cursor()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 232, in _cursor
self.ensure_connection()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbutils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 216, in ensure_connection
self.connect()
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsbasebase.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesdjangodbbackendsmysqlbase.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdb__init__.py", line 85, in Connect
return Connection(*args, **kwargs)
File "D:ProgramLiquidMarketvenvlibsite-packagesMySQLdbconnections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2059, <NULL>)


Using python 3.6.6 and mysqlclient 1.3.13, although 1.3.12 has also been tried.



Database settings:



DATABASES = {
'default': {
'ENGINE': "django.db.backends.mysql", # 'mysql.connector.django'
'NAME': 'testdb',
'USER': 'root',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'autocommit': True,
},
},
}






python mysql django python-3.x database-connection






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 11 at 19:59









Roman Pokrovskij

4,11233978




4,11233978










asked Aug 20 at 7:40









Marcus Grass

196114




196114












  • Please post your database settings in Django.
    – Sachin Kukreja
    Aug 20 at 7:46












  • @SachinKukreja Added to post!
    – Marcus Grass
    Aug 20 at 7:55










  • Are you able to authenticate into the mysql client (without using Django)?
    – Sachin Kukreja
    Aug 20 at 8:17












  • @SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
    – Marcus Grass
    Aug 20 at 8:20




















  • Please post your database settings in Django.
    – Sachin Kukreja
    Aug 20 at 7:46












  • @SachinKukreja Added to post!
    – Marcus Grass
    Aug 20 at 7:55










  • Are you able to authenticate into the mysql client (without using Django)?
    – Sachin Kukreja
    Aug 20 at 8:17












  • @SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
    – Marcus Grass
    Aug 20 at 8:20


















Please post your database settings in Django.
– Sachin Kukreja
Aug 20 at 7:46






Please post your database settings in Django.
– Sachin Kukreja
Aug 20 at 7:46














@SachinKukreja Added to post!
– Marcus Grass
Aug 20 at 7:55




@SachinKukreja Added to post!
– Marcus Grass
Aug 20 at 7:55












Are you able to authenticate into the mysql client (without using Django)?
– Sachin Kukreja
Aug 20 at 8:17






Are you able to authenticate into the mysql client (without using Django)?
– Sachin Kukreja
Aug 20 at 8:17














@SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
– Marcus Grass
Aug 20 at 8:20






@SachinKukreja yeah, using mysql-connector-python also "works", although it led to other problems...stackoverflow.com/questions/51920779/…
– Marcus Grass
Aug 20 at 8:20














1 Answer
1






active

oldest

votes

















up vote
0
down vote













enter image description here



change the way of encryption of the new version mysql,because django cant support the new encryption






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51926091%2fdjango-mysqlclient-backend-produces-django-db-utils-operationalerror-2059-nu%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    enter image description here



    change the way of encryption of the new version mysql,because django cant support the new encryption






    share|improve this answer



























      up vote
      0
      down vote













      enter image description here



      change the way of encryption of the new version mysql,because django cant support the new encryption






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        enter image description here



        change the way of encryption of the new version mysql,because django cant support the new encryption






        share|improve this answer














        enter image description here



        change the way of encryption of the new version mysql,because django cant support the new encryption







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 21 hours ago









        Pengyy

        18.5k153951




        18.5k153951










        answered 21 hours ago









        mengLV LI

        72




        72






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51926091%2fdjango-mysqlclient-backend-produces-django-db-utils-operationalerror-2059-nu%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            Popular posts from this blog

            横浜市

            Rostock

            Europa