1
cloudzhou 2012-09-21 17:19:21 +08:00
给出所有的settings信息,特别是数据库配置那一层
|
2
touch OP @cloudzhou
4 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycop g2', 'mysql', 'sqlite3' or 'oracle'. 15 'NAME': 'mysql', # Or path to database fi le if using sqlite3. 16 'USER': 'root', # Not used with sqlite3. 17 'PASSWORD': '123456', # Not used with sqlite3 . 18 'HOST': '/var/run/mysqld', # Set to empty string for localhost. Not used with sqlite3. 19 'PORT': '', |
3
napoleonu 2012-09-21 17:52:47 +08:00
走TCP连接MySQL,即使是本地的MySQL。即:HOST用IP。
|
4
touch OP @napoleonu
改ip还是2002错误 4 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycop g2', 'mysql', 'sqlite3' or 'oracle'. 15 'NAME': 'mysql', # Or path to database fi le if using sqlite3. 16 'USER': 'root', # Not used with sqlite3. 17 'PASSWORD': '123456', # Not used with sqlite3 . 18 'HOST': '127.0.0.1', # Set to empty strin g for localhost. Not used with sqlite3. 19 'PORT': '3306', # Set to empty string for default. Not used with s 直接运用mysql又没问题 |
5
touch OP 看了下my.cnf中的配置sock
是 socket = /var/run/mysqld/mysqld.sock 和报错的地址不一样 |
7
skydiver 2012-09-21 20:04:00 +08:00
注释里面写着呢, Set to empty string for localhost
|