This looks like your Mysql user can login without password in localhost
(are you sure, your user has correct permissions?).
Try to create a user with password and allow login from localhost, and
change your django settings, also try to connect with your user with mysql
client from localhost.



El vie., 20 mar. 2020 a las 14:55, Victor (<olowofesovic...@gmail.com>)
escribió:

> What's the database variable in your settings.py file
>
> On Friday, March 20, 2020 at 2:54:05 PM UTC+1, Ifeanyi Chielo wrote:
>>
>> Hello,
>> I am new to Python django, I have been making efforts to connect a django
>> application to mysql without success. Bellow is the information that I got
>> PS C:\Users\IFEANYI CHIELO\divine> python manage.py migrate
>> Traceback (most recent call last):
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 216, in ensure_connection
>>     self.connect()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 194, in connect
>>     self.connection = self.get_new_connection(conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\base.py",
>> line 227, in get_new_connection
>>     return Database.connect(**conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\__init__.py",
>> line 84, in Connect
>>     return Connection(*args, **kwargs)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\connections.py",
>> line 179, in __init__
>>     super(Connection, self).__init__(*args, **kwargs2)
>> MySQLdb._exceptions.OperationalError: (1045, "Access denied for user
>> 'admin'@'localhost' (using password: NO)")
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 15, in <module>
>>     execute_from_command_line(sys.argv)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py",
>> line 381, in execute_from_command_line
>>     utility.execute()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py",
>> line 375, in execute
>>     self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 316, in run_from_argv
>>     self.execute(*args, **cmd_options)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 350, in execute
>>     self.check()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 379, in check
>>     include_deployment_checks=include_deployment_checks,
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\migrate.py",
>> line 59, in _run_checks
>>     issues = run_checks(tags=[Tags.database])
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\checks\registry.py",
>> line 71, in run_checks
>>     new_errors = check(app_configs=app_configs)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\checks\database.py",
>> line 10, in check_database_backends
>>     issues.extend(conn.validation.check(**kwargs))
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\validation.py",
>> line 9, in check
>>     issues.extend(self._check_sql_mode(**kwargs))
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\validation.py",
>> line 13, in _check_sql_mode
>>     with self.connection.cursor() as cursor:
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 255, in cursor
>>     return self._cursor()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 232, in _cursor
>>     self.ensure_connection()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 216, in ensure_connection
>>     self.connect()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\utils.py",
>> line 89, in __exit__
>>     raise dj_exc_value.with_traceback(traceback) from exc_value
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 216, in ensure_connection
>>     self.connect()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 194, in connect
>>     self.connection = self.get_new_connection(conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\base.py",
>> line 227, in get_new_connection
>>     return Database.connect(**conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\__init__.py",
>> line 84, in Connect
>>     return Connection(*args, **kwargs)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\connections.py",
>> line 179, in __init__
>>     super(Connection, self).__init__(*args, **kwargs2)
>> django.db.utils.OperationalError: (1045, "Access denied for user 
>> 'admin'@'localhost'
>> (using password: NO)")
>> PS C:\Users\IFEANYI CHIELO\divine>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cb1c789e-f945-4b40-94da-f9fbde883ea2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/cb1c789e-f945-4b40-94da-f9fbde883ea2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyNkjrRKZPv6V01ZZ6%3DbU3LNGkGT_g2hSWWYVq_rky_i2A%40mail.gmail.com.

Reply via email to