python - 如何运行 MySQL 数据库作为 Rasa 服务器的跟踪器存储?
问题描述
端点.yml
tracker_store:
type: SQL
dialect: "mysql" # the dialect used to interact with the db
url: "127.0.0.1:3306" # (optional) host of the sql db, e.g. "localhost"
db: "rasa" # path to your db
username: "*****" # username used for authentication
password: "*****"
我正在使用 docker-compose 来运行 Rasa 服务器。
version: '3'
services:
rasa:
image: rasa/rasa:1.10.8-full
expose:
- "5432"
ports:
- "5005:5005"
volumes:
- ./:/app
command: ["run", "--enable-api", "--cors", "*", "--debug"]
mysql:
image: mysql
command: --default-authentication-plugin=mysql_native_password
volumes:
- .data/mysql:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: "*****"
MYSQL_ALLOW_EMPTY_PASSWORD: "No"
MYSQL_DATABASE: rasa
ports:
- "3306"
app:
image: rasa_actions:latest
expose:
- "5055"
我也试过用 mysql+pymysql 或 postgresql 替换方言。前者给出模块错误,后者给出连接错误,尽管数据库可以正常访问。
我在网上读到 MySQL 和 Rasa 存在一些问题。我需要澄清一下如何使用它。
解决方案
您看到哪个错误消息?一般来说,我们建议pymysql
用作方言。
推荐阅读
- visual-paradigm - 如何在视觉范式 10 中的图表更改后更新图表?
- maven - Maven:在下载的项目 pom 上找不到工件
- loopbackjs - 环回错误 - 回调已被调用
- amazon-web-services - Cloudformation 循环依赖混淆
- python - 如何在不导入普通 tkinter 窗口的情况下导入 tkinter msgbox
- matlab - 在matlab中将一个目录中的多个图像显示为一个图形?
- node.js - 在生产模式下主动登录?这是个好主意吗?
- apache-camel - 在 Camel 中为多个路由器使用文件名
- c++ - c++中的嵌套结构函数
- python - 如何从 Keras 嵌入层获取词向量