<ahref="http://www.iredmail.org"target="_blank">iRedMail web site</a>
// <ahref="./index.html">Document Index</a>
</div><h1id="log-executed-sql-commands-in-mysqlmariadb">Log executed SQL commands in MySQL/MariaDB</h1>
<blockquote>
<p>Don't know where MySQL config file is? check this tutorial:
<ahref="file.locations.html#mysql-mariadb">Locations of configuration and log files of mojor components</a>.</p>
</blockquote>
<p>To log executed SQL commands, please add below two settings in MySQL/MariaDB
config file <code>my.cnf</code>:</p>
<pre><code>[mysqld]
general_log = 1
general_log_file = /var/log/mysql.log
</code></pre>
<p>Then restart MySQL/MariaDB service.</p>
<p>Note: MySQL/MariaDB daemon user must have permission to write this log file.</p><pstyle="text-align: center; color: grey;">Document published under a <ahref="http://creativecommons.org/licenses/by-nd/3.0/us/"target="_blank">CC BY-ND 3.0</a> license. If you found something wrong, please do <ahref="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>