首页 > 代码库 > django 的mysql数据配置
django 的mysql数据配置
原地址:http://blog.csdn.net/gamesofsailing/article/details/21465327
在成功安装python-mysql后,开始配置django的mysql连接配置
打开django项目下的setting.py文件,将DATABASES改成下面这样
DATABASES = {
‘default‘: {
‘ENGINE‘:‘django.db.backends.mysql‘,
‘NAME‘:‘mysite‘,
‘USER‘:‘root‘,
‘PASSWORD‘:‘‘,
‘HOST‘:‘127.0.0.1‘,
‘PORT‘:‘3306‘,
}
}
最后运行:
python mange.py dbshell
成功进入mysql shell
[plain] view plaincopy
- mylittlefishdeMacBook-Air:mysite mylittlefish$ python manage.py dbshell
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 5
- Server version: 5.6.16 MySQL Community Server (GPL)
- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
- mysql>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。