Previously i have setup a server with Nginx and MariaDB.
Run Drupal 7 in Nginx
But there is one problem in this setup. I cannot restart the MariaDB service. Whenever it is down, i have to restart the server instance.
At first, i thought the failure is caused by the modification of the /etc/mysql/my.cnf. So i try to restore the original my.cnf. The following solution helps you to restore the default package configuration file.
1. Find out the package of that default file by dpkg -S.
dpkg -S my.cnf
2. Backup the wrongly edited config file.
mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
3. Restore the file by the following command. (Need sudo for root privilege)
apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall mysql-common
4. If everything works fine, you will get the following output.
Configuration file '/etc/mysql/my.cnf', does not exist on system. Installing new config file as you requested.
Unfortunately, the MariaDB problem is not related to the my.cnf settings. Anyway, hope this solution could help if you have broken a config file.
Done =)
Reference: Ask Ubuntu – How can I restore configuration files?