6👍
Run the following in mysql console, to change the password encryption method to the old version in Mysql(it is changed to use cha2 in Mysql 8.0)
mysql -u root -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';
FLUSH PRIVILEGES;
Then you should be free to run python manage.py migrate
.
1👍
In my case it works when i typed every key in capital letter like this
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'myproj',
'USER': 'root',
'PASSWORD': 'password',
'PORT': '3306',
'HOST': 'localhost',
}
}
Hope atleast it helps some noob like me.
- [Django]-Possible to use mixins in function based views?
- [Django]-Internet Explorer does not talk with django dev server
0👍
The manage.py
should pick up the database access credentials from the settings.py
, that’s a specific database user (and of course that user’s password as well). It’s would be a security mistake to react to this error message by granting database login privileges to the local user, god forbid to the root!
The question is rather: why Django doesn’t pick up the credentials from settings.py
? In my case there were problems with the settings.py
(we were restructuring our build pipeline from django pipeline to webpack) and I needed to remove pipeline related parts from my settings.py
for the fix. It’s a question why I didn’t get any python error message about the settings.py
problems, but instead I got this error which is not local to the real problem. That error message is just a transitive result of the source problem. Once I fixed the manage.py
, the credentials were picked up from the DATABASE settings as usual and everything went smooth.
So the solution is to inspect and debug the settings.py
, which is kinda hard because I don’t get message about the direct error.
- [Django]-Encrypt and Decrypt information in a cookie
- [Django]-Django: Password protect photo url's?
- [Django]-Locating file path from a <InMemoryUploadedFile> Django object
- [Django]-Sprinkling VueJs components into Django templates
- [Django]-Django-social-auth redirect after login
0👍
For anyone stumbling across this, I was actually trying to use a password but was accidentally setting PASSWORD
to None
. This explained why it was saying using password: NO
. Make sure your PASSWORD
isn’t None
.
- [Django]-How to make a model instance read-only after saving it once?
- [Django]-Pass a list as a parameter to django tag
- [Django]-How to unregister table from django admin whose created when package are installed
- [Django]-Cumulative (running) sum of field Django and MySQL
- [Django]-Django widget for a dropdown list
0👍
Use the following commands
service myql stop
sudo /opt/lampp/lampp stop
sudo netstat -nap | grep :80
If apache server is running it will show you a number before "apache2" keyword
If yes write
sudo kill number
sudo /opt/lampp/lampp start
If not
sudo /opt/lampp/lampp start
- [Django]-How to import a template tag in the interactive shell?
- [Django]-Django 1054 – Unknown Column in field list
- [Django]-Django : ModelForm with OneToOneField
0👍
I solved this problem by just changing the PASSWORD
field in the settings.py
(DATABASES dict) to password
.
- [Django]-How to properly extend django User model
- [Django]-Check if item is in ManyToMany field?
- [Django]-Python google ouath authentication decode and verify id_token
0👍
If root user has password that you made. Just in setting.py change ‘PASSWORD’: to your real password. worked for me.