django2.07版本连接mysql服务器 1130, "Host 'DESKTOP-FK0AGS4' is not allowed to connect to this MySQL server
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': "mxxshop", 'USER': 'root', 'PASSWORD': "123456", 'HOST': "localhost", 'OPTIONS':{'init_command':'SET default_storage_engine=INNODB;'} # 'OPTIONS': { 'init_command': 'SET storage_engine=INNODB;' } 之前版本是这条 }
'OPTIONS':{'init_command':'SET default_storage_engine=INNODB;'}新版本改成这条即可