MySQL

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
  
 
When using this module for storing CDRs, also read [call.cdr] section in [[Register|Register]].
 
When using this module for storing CDRs, also read [call.cdr] section in [[Register|Register]].
 +
 +
===Check if module is loaded===
 +
 +
 +
'''Note:''' Check if module MySQL is loaded. It is required to be loaded so that Yate can connect to database.
 +
 +
When Yate starts you can see a list of modules that are loaded. If MySQL does not appear, you must install the devel packages for MySQL.
 +
 +
Another way
  
 
===Configuration file===
 
===Configuration file===
 +
 +
The file is found in directory conf.d where Yate source are.<br>
 +
The file must be renamed from mysqldb.conf.sample into mysqldb.conf.<br>
 +
This file has 2 sections:
 +
* the general section that holds the common settings to all connections
 +
* each section in this file describes a database connection. The section name is the account name of the connection.
  
 
mysqldb.conf
 
mysqldb.conf

Revision as of 16:02, 19 March 2013

This module is used to make the connection between Yate and a MySQL database.

When using this module for storing CDRs, also read [call.cdr] section in Register.

Check if module is loaded

Note: Check if module MySQL is loaded. It is required to be loaded so that Yate can connect to database.

When Yate starts you can see a list of modules that are loaded. If MySQL does not appear, you must install the devel packages for MySQL.

Another way

Configuration file

The file is found in directory conf.d where Yate source are.
The file must be renamed from mysqldb.conf.sample into mysqldb.conf.
This file has 2 sections:

  • the general section that holds the common settings to all connections
  • each section in this file describes a database connection. The section name is the account name of the connection.

mysqldb.conf

[general]
; This section is special - holds settings common to all connections

; priority: int: Handler priority
;priority=100


; Each other section in this file describes a database connection

;[default]
; The section name is used as the database connection name

; timeout: int: Query timeout in milliseconds - will be rounded to seconds
;timeout=10000

; initretry: int: Interval (in seconds) to retry creating failed connections. Setting it to 0 will disable retrying.
;initretry=10

; host: string: MySQL server to connect to, defaults to local
;host=

; port: int: Port on which the server is listening for connections
;port=0

; database: string: Name of the database to use in queries
;database=yate

; user: string: Username to use to access the database
;user=mysql

; password: string: Password to authenticate the user to the database server
;password=

; socket: string: UNIX socket to use for local connections
;socket=

; compress: bool: Enable use of compression protocol
;compress=disable 

; encoding: string: Character set encoding used to communicate with the server
; If not set or empty will use the default for your system
; This setting is not available on older MySQL client libraries
;encoding=

; poolsize: int: Number of connections to establish for this account
; If not set or empty, it will create only one connection
; Minimum number of connections is 1, maximum is 10
;poolsize=1


Example

;this is where we create a new connection to a MySQL database
;there can be multiple connections to different databases
;the name written between [] will be used in other configuration files to mark the account used 
;Example: in register.conf in the [general] section: account=yatetest

[yatetest]
database=yate
user=mysql
password=yate
Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers