I'm packaging a small system that uses mysql as a database. The system is made in PHP and uses Symfony as a framework.
When installing the system I need to create the database, user and popular.
The package has all dependencies, including mariadb-server and dbconfig-mysql.
Tried to follow the tutorial dbconfig-common, and this is my DEBIAN/config
set -e
. /usr/share/debconf/confmodule
if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
. /usr/share/dbconfig-common/dpkg/config.mysql
dbc_go kaya-rest "$@"
fi
php /etc/nerd4ever/kaya/back-end/bin/console doctrine:migration:migrate -q
I also have it in my archive package: /usr/share/dbconfig-common/data/kaya-rest/install/mysql (created after reading other examples)
CREATE DATABASE IF NOT EXISTS kaya;
CREATE USER IF NOT EXISTS 'kaya'@'localhost' IDENTIFIED BY '<my_password>';
GRANT ALL PRIVILEGES ON kaya.* TO 'kaya'@'localhost';
FLUSH PRIVILEGES;
I expected that at the end of the installation the database, user and password had been created and the doctrine migrations had populated the database, none of this happened and the installation does not show any error message.
The mysql status at the end of the installation is stopped. At no point during the installation of my package do I start the database.