第 10 章 Managing databases with the command-line assistant daemon


To store information and provide access to your history database, the command-line assistant daemon (clad) uses an unencrypted SQLite database by default. If you require a different database for your deployment, you can install and connect to a different database back end, such as PostgreSQL or MySQL.

注意

clad does not include these databases by default to avoid bringing unwanted dependencies to your system.

With the unencrypted SQLite database, you can store information and have access to your history database from the command-line assistant.

Prerequisites

  • You have installed the command-line assistant.

Procedure

  1. Install the database of your choice:

    • To install MySQL, enter:

      # dnf install python3-PyMySQL
    • To install PostgreSQL, enter:

      # dnf install python3-psycopg2
  2. Access your database configuration file at /etc/xdg/command-line-assistant/config.toml.
  3. Locate and comment out the default configuration. For example:

     [database]
        # type = "sqlite"
        # connection_string = "/var/lib/command-line-assistant/history.db"
  4. Configure the database of your choice. The following information is also available in /etc/xdg/command-line-assistant/config.toml.

    1. Set the database type, where <db_type> can be mysql or postgresql.
    2. Set the database details.

       type = <db_type>
       host = "<hostname_or_ip_address>"
       port = "5432"
       username = "<database_user_name>"
       password = "<password>"
       database = "<database_name>"
  5. After changing the database type, restart the clad daemon to apply the changes:

    $ sudo systemctl restart clad
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部