Setup database: MySQL or MariaDB
Requirements
-
MySQL 4.1.1 or later, and any releases of MariaDB will work.
-
Install DBD-mysql package.
-
MyISAM or Aria, and InnoDB or XtraDB storage engines may work. Check
default-storage-engine
anddefault-table-type
options of your MySQL / MariaDB server.
General instruction
-
Ensure that
sympa.conf
includes appropriate values for these parameters:db_type
,db_name
,db_host
,db_port
(optional),db_user
anddb_passwd
(optional).-
db_type
must beMySQL
ormysql
(obsoleted). -
If
db_host
is set tolocalhost
, Sympa will connect to database on local machine using Unix domain socket. Otherwise, if another host name or IP address is set, TCP socket will be used (Ifdb_port
is not specified,3306
will be used as port).
Example:
db_type MySQL db_name sympa db_host localhost db_user sympa db_passwd (secret)
-
-
Create database and database user:
$ mysql mysql> CREATE DATABASE sympa CHARACTER SET utf8; mysql> GRANT ALL PRIVILEGES ON sympa.* TO <db_user>@<client host> -> IDENTIFIED BY '<db_passwd>'; mysql> QUIT
-
Create table structure:
# sympa.pl --health_check
Note
- MySQL/MariaDB 5.5.3 or later provides
utf8mb4
character set which covers full range of Unicode including such as Chinese ideographs used for persons' names. As of Sympa-6.2a.33 r8753, bothutf8
andutf8mb4
character sets are supported. To useutf8mb4
character set, you might want to replaceutf8
in SQL statement above withutf8mb4
.
Instruction for earlier releases of Sympa
Note
- This section describes instruction with Sympa prior to 6.2.
-
Set appropriate parameters in
sympa.conf
as described in above. -
Create database and table structure (Note: replace
$SCRIPTDIR
):$ mysql < $SCRIPTDIR/create_db.mysql
-
Grant database privileges:
$ mysql mysql> GRANT ALL PRIVILEGES ON sympa.* TO <db_user>@<client host> -> IDENTIFIED BY '<db_passwd>'; mysql> QUIT
Tuning
With Sympa 6.0.x and 6.1.x, Sympa uses database as message spool. Thus, size of database server's communication buffer has to be as large as it can accept messages.
To know maximum message size allowed to be stored in database, run:
# sympa.pl --test_database_message_buffer
Then, if the result was smaller than what you expect, make
max_allowed_packet
parameter in my.cnf
larger, and run the command above again.