Skip to content

Setup Gammu SMSD DB

tenzap edited this page Mar 6, 2022 · 1 revision

Since 0.2.9, Kalkun requires you to setup the gammu database first.

Kalkun uses the database that is created by gammu with all the tables created by gammy. Kalkun then adds supplementary tables and some columns to the gammu tables. So there is no such case where one has a gammu database separate from the kalkun database. Both software share the same database.

To make it easier to set kalkun up, this guide explains how to set the Gammu-SMSD database up for MySQL/MariaDB and for PostgreSQL.

The database name is set to kalkun.


With MySQL

Create database and privileges

You can do it via MySQL console or with MySQL GUI like phpMyAdmin.

If you're using MySQL console, follow the following step.

First, connect to your mysql server (as regular user run):

mysql -u root -p

Create kalkun database:

CREATE DATABASE kalkun;

It's always good idea to create new user and privileges for kalkun database, so other users like root will not get interrupted, it's optional but it's recommended to do this.

GRANT ALL PRIVILEGES ON kalkun.* TO 'username'@'%' IDENTIFIED BY 'password';

IMPORTANT: You should change username and password.

Last, flush users privileges to activate your changes:

FLUSH PRIVILEGES;

Import gammu database schema

The schema is in the gammu sources. You may find the SQL script in gammu/docs/sql/mysql.sql. If you are on Debian, it is likely the file is in /usr/share/doc/gammu-smsd/examples/mysql.sql.

Again. you can do the import using MySQL console or MySQL GUI like phpMyAdmin.

If you're using MySQL console (as root user run):

mysql kalkun -u username -p < gammu/docs/sql/mysql.sql

With PostgreSQL

Create database and privileges

Open a psql shell and execute these SQL commands:

CREATE USER username WITH password 'password' NOCREATEDB NOCREATEROLE;
CREATE DATABASE kalkun WITH OWNER = username;

Import gammu database schema

The schema is in the gammu sources. You may find the SQL script in gammu/docs/sql/pgsql.sql. If you are on Debian, it is likely the file is in /usr/share/doc/gammu-smsd/examples/pgsql.sql.

psql -U username -h localhost kalkun < gammu/docs/sql/pgsql.sql

With SQLite3

TODO

Clone this wiki locally