res_config_mysql.conf 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ;
  2. ; Sample configuration for res_config_mysql.c
  3. ;
  4. ; The value of dbhost may be either a hostname or an IP address.
  5. ; If dbhost is commented out or the string "localhost", a connection
  6. ; to the local host is assumed and dbsock is used instead of TCP/IP
  7. ; to connect to the server. If no dbcharset is specified, the connection
  8. ; is made with no extra charset configurations sent to MySQL, leaving all
  9. ; configured MySQL charset options and defaults untouched.
  10. ;
  11. ; Multiple database contexts may be configured, with the caveat that
  12. ; all context names should be unique and must not contain the slash ('/')
  13. ; character. If you wish to separate reads from writes in your database
  14. ; configuration, you specify the database (NOT HERE, in other files)
  15. ; separated by a slash, read database first. If your database
  16. ; specification does not contain a slash, the implication is that reads
  17. ; and writes should be performed to the same database.
  18. ;
  19. ; For example, in extconfig.conf, you could specify a line like:
  20. ; sippeers => mysql,readhost.asterisk/writehost.asterisk,sippeers
  21. ; and then define the contexts [readhost.asterisk] and [writehost.asterisk]
  22. ; below.
  23. ;
  24. ; The requirements parameter is available only in Asterisk 1.6.1 and
  25. ; later and must be present in all contexts. It specifies the behavior
  26. ; when a column name is required by the system. The default behavior is
  27. ; "warn" and simply sends a warning to the logger that the column does
  28. ; not exist (or is of the wrong type or precision). The other two
  29. ; possibilities are "createclose", which adds the column with the right
  30. ; type and length, and "createchar", which adds the column as a char
  31. ; type, with the appropriate length to accept the data. Note that with
  32. ; the MySQL driver, both "createclose" and "createchar" will, on occasion,
  33. ; widen a table column width to meet the requirements specified.
  34. ;
  35. [general]
  36. ;dbhost = 127.0.0.1
  37. ;dbname = asterisk
  38. ;dbuser = myuser
  39. ;dbpass = mypass
  40. ;dbport = 3306
  41. ;dbsock = /tmp/mysql.sock
  42. ;dbcharset = latin1
  43. ;requirements=warn ; or createclose or createchar