Modules/2.0/mysql

From the makers of InspIRCd.
Jump to: navigation, search

mysql module (2.0 version)

Current Future
2.0 Documentation 3.0 Documentation
Return to the 2.0 Module List
Description
This module is a service provider module, which means it has no real directly usable functions of its own, however it provides an essential service which is used by other modules. This module allows other modules to access SQL using a unified interface, minimizing the number of persistent connections and abstracting the actual database software from the SQL queries sent to it.
Configuration Tags
To use this module you must define one or more database connections, using tags like the one below:
<database name="mydb"
          user="myuser"
          pass="mypass"
          host="localhost"
          port="3306"
          id="anytext">

The variables in the tag have the following meanings:

  • name - The name of the database this connection is bound to. This may be any database you have ability to access
  • user - The MySQL username with which you want to access the database
  • pass - The password required to access the database
  • host - The hostname of the database. Most of the time you will just want localhost here
  • port - The port to connect to if you run your server on a non-standard port.
  • id - The id of the database. Dependent modules will use this ID to refer to the connection, rather than its credentials, so that the credentials are specified only in one place. Any text can be used as the database ID. In the previous version of the SQL API this was an integer, however it is now a string to allow for more descriptive IDs.

You may define as many databases as you wish, but remember it is most secure to only define ones that your modules will actually use.

Modes
This module does not implement any extra user or channel modes.
Extended Bans (Extbans)
This module implements no extended bans.
Commands
This module adds no extra commands.
Special Notes
MySQL databases are very resource intensive in terms of memory usage. Modules should refrain from using MySQL unless it is necessary. For example, to interface with a website written in a scripting language, such as PHP or Perl, or to interface with a proprietary system which uses MySQL.
Extra ModuleThis module is an 'extra' module. This means that by default it is not compiled when you type make to build your IRCd. To enable this module follow these steps.
Dependencies
*MySQL - The MySQL Database Server