-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
初始化数据失败 #1
Comments
已经在config.ini中指定了cmdb这个用户,但是在初始化数据的时候还是用root这个用户去链接. |
首先要确认安装了MySQLdb,木块,然后python-devel ,然后在config.ini里面的数据库配置上面配置好自己的相对名称,看样子应该是用户名或者密码没有授权。检查一下这个用户名和密码能否登录 在 2015-09-23 11:08:30,"Xin Liu" [email protected] 写道: 问题: — |
授权是没有问题的 mysql -ucmdb -predhat -hlocalhost
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, 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> python-MySQLdb已经安装python
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
|
问题已经解决了,在你的CMDB/setings.py中已经写死了配置了,修改下就可以了 |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'cmdb', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'cmdb',
'PASSWORD': 'redhat',
'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '3306', # Set to empty string for default.
}
} 这个地方应该引入config.ini的配置吧 |
嗯对的,这里我写好了模块,应该不用你自己修改的 At 2015-09-23 11:24:50, "Xin Liu" [email protected] wrote: DATABASES = { 这个地方应该引入config.ini的配置吧 — |
稍等一下,好像我打包错了 At 2015-09-23 11:24:50, "Xin Liu" [email protected] wrote: DATABASES = { 这个地方应该引入config.ini的配置吧 — |
恩,默认的话只能用root这个用户,以及密码必须是123456 |
您好,已经更新代码了,可以再去github上面下载最新版本 At 2015-09-23 11:24:50, "Xin Liu" [email protected] wrote: DATABASES = { 这个地方应该引入config.ini的配置吧 — |
谢谢支持,刚才那个版本应该是封装的时候漏封装了, At 2015-09-23 11:24:50, "Xin Liu" [email protected] wrote: DATABASES = { 这个地方应该引入config.ini的配置吧 — |
您好上面的问题,已经解决了,麻烦重新拉一下代码,刚刚是版本推送时候出问题了,忘记封装了 |
问题:
异常日志:
The text was updated successfully, but these errors were encountered: