当前位置:网站首页>HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
2022-07-06 02:13:00 【iBigder】
接上篇:
HttpRunnerManager安装(二)-Linux下安装RabbitMQ踩坑合集
一、MySQL上创建HttpRunner数据库
二、修改配置文件 HttpRunnerManager/settings.py
和你安装的mysql实际配置信息一致
vi /root/HttpRunnerManager3-master/HttpRunnerManager/settings.py
修改后记得保存
三、同步数据库
1、上面我们创建了一个名称为hrun的空数据库,这个数据库下没有任何数据表。现在我们将同步数据库的数据表。需要先进入到 HttpRunnerManager 的根目录:
cd /root/HttpRunnerManager3-master
生成数据迁移脚本,执行:
python manage.py makemigrations ApiManager
这里可能会执行报错,一般报错原因是依赖包不匹配导致、需要卸载旧依赖包、使用和python3.7.3匹配的依赖包,任何疑问加我v:**「newbigder」**或者公z号留言:「Bigder」
比如安装的markupsafe版本过高,我降低版本。
指定安装某个版本指令:
python -m pip install markupsafe==2.0.1
python3.7.3验证过的匹配的版本号:
Package Version
------------------ ---------
amqp 2.6.1
anyjson 0.3.3
appdirs 1.4.4
attrs 21.4.0
bcrypt 3.2.2
billiard 3.6.4.0
black 19.10b0
cached-property 1.5.2
celery 4.4.7
certifi 2022.6.15
cffi 1.15.0
chardet 3.0.4
click 8.1.3
click-didyoumean 0.3.0
click-plugins 1.1.1
click-repl 0.2.0
cryptography 37.0.3
Django 2.2.12
django-celery 3.3.1
dwebsocket 0.5.12
eventlet 0.22.1
flower 0.9.5
greenlet 1.1.2
httprunner 3.1.4
humanize 4.2.2
idna 2.10
importlib-metadata 4.12.0
Jinja2 2.11.2
jmespath 0.9.5
kombu 4.6.11
loguru 0.4.1
MarkupSafe 2.0.1
more-itertools 8.13.0
mysqlclient 1.4.6
packaging 21.3
paramiko 2.7.1
pathspec 0.9.0
pi 0.1.2
pip 22.1.2
pluggy 0.13.1
prometheus-client 0.8.0
prompt-toolkit 3.0.30
py 1.11.0
pycparser 2.21
pycryptodome 3.6.5
pydantic 1.9.1
pyflakes 2.2.0
PyNaCl 1.5.0
pyparsing 3.0.9
pytest 5.4.3
pytest-html 2.1.1
pytest-metadata 2.0.1
pytz 2022.1
PyYAML 5.3.1
regex 2022.6.2
requests 2.24.0
robotframework 3.2.2
sentry-sdk 0.14.4
setuptools 40.8.0
six 1.16.0
sqlparse 0.4.2
toml 0.10.2
tornado 6.1
typed-ast 1.5.4
typing_extensions 4.2.0
urllib3 1.25.11
vine 1.3.0
wcwidth 0.2.5
zipp 3.8.0
报错1:
django.db.utils.OperationalError: (1049, “Unknown database ‘hrun’”),
原因:/root/HttpRunnerManager3-master/HttpRunnerManager/settings.py
文件数据库修改不完整、重新修改一遍
继续执行:
python manage.py makemigrations ApiManager
[[email protected] HttpRunnerManager3-master]# python manage.py makemigrations ApiManager
报错2:
You are trying to add a non-nullable field ‘user_account’ to debugtalk without a default; we can’t do that (the database needs something to populate existing rows).
Please select a fix:
Provide a one-off default now (will be set on all existing rows with a null value for this column)
Quit, and let me add a default in models.py 输入2,退出:
按照提示解决:
vi /root/HttpRunnerManager3-master/ApiManager
编辑文件并且将包含:user_account的字段后面全部加上默认值,如图:
继续执行:python manage.py makemigrations ApiManager , 成功!
2、应用到db生成数据表,成功!
python manage.py migrate
3、登入MySQL的hrun库检查,表已经创建成功了!
四、创建后台管理员用户
python manage.py createsuperuser
下一篇:
HttpRunnerManager安装(四)-Linux下启动Django服务&登录httprunerManager
以上,
Bigder
边栏推荐
- Leetcode sum of two numbers
- MySQL learning notes - subquery exercise
- PHP campus financial management system for computer graduation design
- How to use C to copy files on UNIX- How can I copy a file on Unix using C?
- Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
- [Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice
- leetcode3、實現 strStr()
- HDU_p1237_简单计算器_stack
- 技术管理进阶——什么是管理者之体力、脑力、心力
- Publish your own toolkit notes using NPM
猜你喜欢
随机推荐
Minecraft 1.18.1、1.18.2模组开发 22.狙击枪(Sniper Rifle)
Derivation of Biot Savart law in College Physics
在线怎么生成富文本
Redis string type
[eight part essay] what is the difference between unrepeatable reading and unreal reading?
剑指 Offer 30. 包含min函数的栈
729. 我的日程安排表 I / 剑指 Offer II 106. 二分图
[solution] every time idea starts, it will build project
Method of changing object properties
Paper notes: limit multi label learning galaxc (temporarily stored, not finished)
阿裏測開面試題
使用npm发布自己开发的工具包笔记
抓包整理外篇——————状态栏[ 四]
Card 4G industrial router charging pile intelligent cabinet private network video monitoring 4G to Ethernet to WiFi wired network speed test software and hardware customization
Using SA token to solve websocket handshake authentication
MySQL index
MySQL learning notes - subquery exercise
Genius storage uses documents, a browser caching tool
2022 edition illustrated network pdf
02. Go language development environment configuration