The standard version of IlohaMail includes full MySQL support. If you decide to use a MySQL backend, sessions must be handled by MySQL. However, you can still use a file-based backend for contacts and user preference management.
For detailed information on the differences between the two backends, read this FAQ.Consult the MySQL documentation on how to use MySQL. Here, we'll assume you have a properly configured and operational database. (Note: The example commands below have username/password options omitted. On an actual production database, access to all databases should be password protected.)
- Create a MySQL datsabase.
$mysqladmin create webmail- Create tables. Required/recommended table structures are included in the file {$IlohaMail}/MySQL/sql. The easiest way to do this is to run the sql file through mysql, as such:
$mysql webmail < sql- Configure conf/db_conf.php:
Variable Description $DB_HOST MySQL server (ip or name) $DB_USER MySQL user to connect as $DB_PASSWORD Password of MySQL user $DB_NAME Required MySQL database name (default: "webmail") $DB_TYPE Required Set to "MySQL". $DB_USERS_TABLE Required Name of main table for user management $DB_SESSIONS_TABLE Required Name of sessions management table (default: "sessions") $DB_CONTACTS_TABLE Name of contacts table.
Leave undefined or empty to use default file-based backend.$DB_PREFS_TABLE Name of table containing user prefs.
Leave undefined or empty to use default file-based backend.$DB_COLORS_TABLE Name of table containing user defined colors.
Leave undefined or empty to use default file-based backend.$DB_IDENTITIES_TABLE Table for storing alternate sender identities. $DB_BOOKMARKS_TABLE Table for storing bookmark entries. $DB_CACHE_TABLE Cache table. Optional: comment out to use file-based cache. $DB_LOG_TABLE Name of log table
Leave undefined or empty to use default file-based backend. If using file-based log, make sure log file path is set in conf/conf.inc.NOTE: Logging is inactive by default. Make sure you activate it in conf/conf.inc
$DB_PERSISTENT Set to true to use persistent connections. NOTE: Using persistent database connections may require configuration changes in PHP, Apache, and/or MySQL. Read this document for more information.
- Set value of $backend in conf/conf.inc to "DB"