Skip to content

MYSQL module

This is a module which provides MySQL connectivity for OpenSIPS. It implements the DB API defined in OpenSIPS.

The following modules must be loaded before this module:

  • No dependencies on other OpenSIPS modules.

The following libraries or applications must be installed before running OpenSIPS with this module loaded:

  • libmysqlclient-dev - the development libraries of mysql-client.

If queries take longer than ‘exec_query_threshold’ microseconds, warning messages will be written to logging facility.

Default value is 0 - disabled.

Set exec_query_threshold parameter
...
modparam("db_mysql", "exec_query_threshold", 60000)
...

Time interval after that an connection attempt, read or write request is aborted. The value counts three times, as several retries are done from the driver before it gives up.

The read timeout parameter is ignored on driver versions prior to “5.1.12”, “5.0.25” and “4.1.22”. The write timeout parameter is ignored on version prior to “5.1.12” and “5.0.25”, the “4.1” release don’t support it at all.

Default value is 2 (6 sec).

Set timeout_interval parameter
...
modparam("db_mysql", "timeout_interval", 2)
...

No function exported to be used from configuration file.

Because it dependes on an external library, the mysql module is not compiled and installed by default. You can use one of the next options.

  • edit the “Makefile” and remove “db_mysql” from “excluded_modules” list. Then follow the standard procedure to install OpenSIPS: “make all; make install”.
  • from command line use: ‘make all include_modules=“db_mysql”; make install include_modules=“db_mysql”’.

This event is raised when a MySQL connection is lost or recovered.

Parameters:

  • url - the URL of the connection as specified by the db_url parameter.
  • status - connected if the connection recovered, or disconnected if the connection was lost.

Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)

#NameDevScoreCommitsLines++Lines—
1.Jan Janak (@janakj)1545354063260
2.Henning Westerholt (@henningw)1083226303176
3.Bogdan-Andrei Iancu (@bogdan-iancu)100691702923
4.Daniel-Constantin Mierla (@miconda)2820574157
5.Andrei Pelinescu-Onciul16145451
6.Jiri Kuthan (@jiriatipteldotorg)1163932
7.Vlad Paiu (@vladpaiu)10714438
8.Stefan Darius (@dariusstefan)7413817
9.Razvan Crainea (@razvancrainea)631375
10.Nils Ohlmeier53243

All remaining contributors: Norman Brandinger (@NormB), Dan Pascu (@danpascu), Andreas Heise, Razvan Pistolea, Konstantin Bokarius, Saúl Ibarra Corretgé (@saghul), Sergio Gutierrez, Edson Gellert Schubert.

(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)

(2) including any documentation-related commits, excluding merge commits

(3) ignoring whitespace edits, renamed files and auto-generated files

#NameCommit Activity
1.Stefan Darius (@dariusstefan)Jun 2026 - Jul 2026
2.Razvan Crainea (@razvancrainea)Oct 2011 - Jun 2026
3.Bogdan-Andrei Iancu (@bogdan-iancu)Aug 2002 - Sep 2014
4.Vlad Paiu (@vladpaiu)Feb 2011 - Feb 2012
5.Saúl Ibarra Corretgé (@saghul)Nov 2011 - Nov 2011
6.Razvan PistoleaJul 2009 - Jul 2009
7.Norman Brandinger (@NormB)Aug 2006 - Feb 2009
8.Sergio GutierrezFeb 2009 - Feb 2009
9.Henning Westerholt (@henningw)May 2007 - Jun 2008
10.Daniel-Constantin Mierla (@miconda)Oct 2002 - Mar 2008

All remaining contributors: Konstantin Bokarius, Edson Gellert Schubert, Andreas Heise, Jan Janak (@janakj), Andrei Pelinescu-Onciul, Dan Pascu (@danpascu), Jiri Kuthan (@jiriatipteldotorg), Nils Ohlmeier.

(1) including any documentation-related commits, excluding merge commits

Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Paiu (@vladpaiu), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Henning Westerholt (@henningw), Jan Janak (@janakj).

All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0