请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

pycharm inspectdb 问题

老师按照你的提示 直接用inspectdb > models.py ,我使用了,但是报错。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
manage.py@jkTax > inspectdb dj_nsrxx > models.py 
"C:\Program Files (x86)\JetBrains\PyCharm 2016.3.2\bin\runnerw.exe" D:\mxonline\mx\Scripts\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.3.2\helpers\pycharm\django_manage.py" inspectdb dj_nsrxx > models.py D:/jkTax
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey has `on_delete` set to the desired behavior.
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from __future__ import unicode_literals
 
from django.db import models
 
 
class DjNsrxx(models.Model):
    id = models.AutoField(db_column='Id', primary_key=True)  # Field name made lowercase.
    nsrsbh = models.CharField(db_column='NSRSBH', max_length=20, blank=True, null=True)  # Field name made lowercase.
    nsrmc = models.CharField(db_column='NSRMC', max_length=255, blank=True, null=True)  # Field name made lowercase.
    djzclx_dm = models.CharField(db_column='DJZCLX_DM', max_length=3, blank=True, null=True)  # Field name made lowercase.
    nsrzt_dm = models.CharField(db_column='NSRZT_DM', max_length=2, blank=True, null=True)  # Field name made lowercase.
    hy_dm = models.CharField(db_column='HY_DM', max_length=4, blank=True, null=True)  # Field name made lowercase.
    jdxz_dm = models.CharField(db_column='JDXZ_DM', max_length=9, blank=True, null=True)  # Field name made lowercase.
    zgswj_dm = models.CharField(db_column='ZGSWJ_DM', max_length=11, blank=True, null=True)  # Field name made lowercase.
    zgswskfj_dm = models.CharField(db_column='ZGSWSKFJ_DM', max_length=11, blank=True, null=True)  # Field name made lowercase.
 
    class Meta:
        managed = False
        db_table = 'dj_nsrxx'
D:\mxonline\mx\lib\site-packages\django\db\backends\mysql\base.py:110: Warning: (1017L, u"Can't find file: '.\\king3\\@003e.frm' (errno: 22)")
  return self.cursor.execute(query, args)
# Unable to inspect table '>'
# The error was: (1017, "Can't find file: '.\\king3\\@003e.frm' (errno: 22)")
# Unable to inspect table 'models.py'
# The error was: (1146, "Table 'king3.models.py' doesn't exist")
 
Process finished with exit code 0


正在回答 回答被采纳积分+3

插入代码

1回答

bobby 2017-03-20 09:29:56

The error was: (1146, "Table 'king3.models.py' doesn't exist") 这里报错是kings3.models 表不存在 你可以先试试建一个简单的库 然后测试一下这个命令 然后再回去排查你的数据库的问题

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号