{"id":6681,"date":"2022-09-30T14:46:03","date_gmt":"2022-09-30T14:46:03","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6681"},"modified":"2022-09-30T14:46:03","modified_gmt":"2022-09-30T14:46:03","slug":"location-of-mysql-mariadb-configuration-file-on-debian-11","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2022\/09\/30\/location-of-mysql-mariadb-configuration-file-on-debian-11\/","title":{"rendered":"Location of MySQL &#8211; MariaDB configuration file on Debian 11 and Tuning It"},"content":{"rendered":"<p>Locate mariadb config files:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# cd \/etc\/mysql\/mariadb.conf.d\n# ls -la\ntotal 28\ndrwxr-xr-x 2 root root 4096 Sep 23 22:52 .\ndrwxr-xr-x 4 root root 4096 Sep 30 18:20 ..\n-rw-r--r-- 1 root root  575 Feb 17  2022 50-client.cnf\n-rw-r--r-- 1 root root  231 Feb 17  2022 50-mysql-clients.cnf\n-rw-r--r-- 1 root root  927 Feb 17  2022 50-mysqld_safe.cnf\n-rw-r--r-- 1 root root 3666 Feb 19  2022 50-server.cnf\n-rw-r--r-- 1 root root  570 Feb 17  2022 60-galera.cnf\n\n<\/pre>\n<p>Tweaking mariadb<br \/>\nTo optimize the server, edit 50-server.cnf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nroot@webserver:\/etc\/mysql\/mariadb.conf.d# nano 50-server.cnf\n\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmy.cnf Files\nMariaDB is normally configured by editing the my.cnf file.\n\nThe following my.cnf example files were included with MariaDB until MariaDB 10.3.0. If present, you can examine them to see more complete examples of some of the many ways to configure MariaDB and use the one that fits you best as a base. Note that these files are now quite outdated, so what was huge a few years ago may no longer be seen as such.\n\nmy-small.cnf\nmy-medium.cnf\nmy-large.cnf\nmy-huge.cnf\n\n<\/pre>\n<p>Run the tuner<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwget http:\/\/mysqltuner.pl\/ -O mysqltuner.pl\nThen execute it:\nperl mysqltuner.pl\n<\/pre>\n<p>Create a simple bash script to check if MySQL is running and if not to restart it.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\n\n# Check if MySQL is running\nsudo service mysql status &gt; \/dev\/null 2&gt;&amp;1\n\n# Restart the MySQL service if it's not running.\nif &#x5B; $? != 0 ]; then\n    sudo service mysql restart\nfi\n<\/pre>\n<p>Run this script every 5 minutes using a cron job like this one:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n *\/5 * * * * \/home\/user\/scripts\/monitor.sh &gt; \/dev\/null 2&gt;&amp;1\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Locate mariadb config files: # cd \/etc\/mysql\/mariadb.conf.d # ls -la total 28 drwxr-xr-x 2 root root 4096 Sep 23 22:52 . drwxr-xr-x 4 root root 4096 Sep 30 18:20 .. -rw-r&#8211;r&#8211; 1 root root 575 Feb 17 2022 50-client.cnf -rw-r&#8211;r&#8211; 1 root root 231 Feb 17 2022 50-mysql-clients.cnf -rw-r&#8211;r&#8211; 1 root root 927 Feb 17 &#8230; <a title=\"Location of MySQL &#8211; MariaDB configuration file on Debian 11 and Tuning It\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2022\/09\/30\/location-of-mysql-mariadb-configuration-file-on-debian-11\/\" aria-label=\"Read more about Location of MySQL &#8211; MariaDB configuration file on Debian 11 and Tuning It\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-6681","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6681"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6681\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}