zoukankan      html  css  js  c++  java
  • 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在CODE上查看代码片派生到我的代码片
     
    1. mylittlefishdeMacBook-Air:mysite mylittlefish$ python manage.py dbshell  
    2. Welcome to the MySQL monitor.  Commands end with ; or g.  
    3. Your MySQL connection id is 5  
    4. Server version: 5.6.16 MySQL Community Server (GPL)  
    5.   
    6. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.  
    7.   
    8. Oracle is a registered trademark of Oracle Corporation and/or its  
    9. affiliates. Other names may be trademarks of their respective  
    10. owners.  
    11.   
    12. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.  
    13.   
    14. mysql>   
  • 相关阅读:
    css3 动画+动画库
    垃圾回收 及 内存泄漏
    做菜体会
    微信小程序
    微信公众号2
    JavaScript 原生事件
    Bootstrap框架
    Less 和 Sass
    HTML标签总结
    表单元素
  • 原文地址:https://www.cnblogs.com/123ing/p/3903377.html
Copyright © 2011-2022 走看看