Next: , Up: Global Configuration


4.5.1 Database Specification

Buildbot requires a connection to a database to maintain certain state information, such as tracking pending build requests. By default this is stored in a sqlite file called 'state.sqlite' in the base directory of your master. This can be overridden with the db_url parameter.

This parameter is of the form:

driver://[username:password@]host:port/database[?args]

For sqlite databases, since there is no host and port, relative paths are specified with sqlite:/// and absolute paths with sqlite:////

     c['db_url'] = "sqlite:///state.sqlite"
     c['db_url'] = "mysql://user:pass@somehost.com/database_name?max_idle=300"

The max_idle argument for MySQL connections should be set to something less than the wait_timeout configured for your server. This ensures that connections are closed and re-opened after the configured amount of idle time. If you see errors such as _mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away'), this means your max_idle setting is probably too high. show global variables like 'wait_timeout'; will show what the currently configured wait_timeout is on your MySQL server.