瀏覽代碼

README.md: section for database backend support

Daniel-Constantin Mierla 5 年之前
父節點
當前提交
149409b671
共有 1 個文件被更改,包括 35 次插入1 次删除
  1. 35 1
      README.md

+ 35 - 1
README.md

@@ -298,7 +298,7 @@ dv=db show "version"
 Executing `dv` inside the interactive shell prints the result of command
 Executing `dv` inside the interactive shell prints the result of command
 `db show "version"`.
 `db show "version"`.
 
 
-#### Examples Of Commands ####
+### Examples Of Commands ###
 
 
 Sample commands to understand quicker the capabilities and how to use it:
 Sample commands to understand quicker the capabilities and how to use it:
 
 
@@ -364,6 +364,40 @@ modparam("jsonrpcs", "transport", 6)
 modparam("jsonrpcs", "pretty_format", 1)
 modparam("jsonrpcs", "pretty_format", 1)
 ```
 ```
 
 
+### Database Backend Support ###
+
+When using `Kamailio` with a database backend and want `kamcli` to manage it, then update
+configuration file `kamcli.ini` and set the attributes in the section `[db]`. Couple of
+these attributes (e.g., database name) can be also provided as cli parameters for some
+`kamcli db ...` sub-commands.
+
+Note: of course, it requires to install the Python extension to connect to the type of
+database to be used, as well as the cli tools for the database type, see the sections
+related to installation for specific details.
+
+One of the most important steps when using `Kamailio` with database backend is the creation
+of the database and its tables. That can be done with:
+
+```
+kamcli db create
+```
+
+By default, when applicable, this command creates database access users and grants the
+appropriate privileges. This behaviour can be controlled via cli parameters.
+
+To create the database tables, `kamcli` needs to know where creation scripts are located.
+For example, when using MySQL for a Kamailio instance installed from sources, the path is:
+
+  * /usr/local/share/kamailio/mysql
+
+This has to be set to `scriptsdirectory` attribute in `[db]` section of `kamcli.ini`, or given
+via `-s` (or `--scripts-directory`) command line parameter. It can also point to the corresponding
+folder in the source code tree, for example:
+
+```
+kamcli db create -s /usr/local/src/kamailio-dev/utils/kamctl/mysql
+```
+
 ### Python2 Support ###
 ### Python2 Support ###
 
 
 The current version of `kamcli` works only with Python3. Python2 has been deprecated
 The current version of `kamcli` works only with Python3. Python2 has been deprecated