2.settings.py的配置文件
DATABASES = {
'default': {
#'ENGINE': 'django.db.backends.sqlite3',
#'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.mysql', '''数据库引擎位置,我的在D:\python27\Lib\site-packages\django\db\backends\mysql下,这个目录下有django支持的数据库引擎
'NAME': 'mypython', #你打开mysql之后需要操作的数据库的库名称
'USER':'root',
'PASSWORD':'aisino',
'HOST':'192.168.1.88',
'PORT':'3306'
}
}
还有到mysql安装目录中修改my.ini中,在mysqld中添加skip-grant-tables修改访问权限