New: troubleshooting/debug.mysql.md.
This commit is contained in:
parent
695ada4be1
commit
b7db0e4144
|
@ -99,13 +99,9 @@ for chapter_dir in ${all_chapter_dirs}; do
|
||||||
hide_article_in_index='YES'
|
hide_article_in_index='YES'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get title.
|
# Get title in markdown file: '# title'
|
||||||
# title format: '# title'
|
|
||||||
_article_title="$(head -1 ${article_file} | awk -F'# ' '{print $2}')"
|
_article_title="$(head -1 ${article_file} | awk -F'# ' '{print $2}')"
|
||||||
# title format: '<h1>title</h1>'
|
|
||||||
#_article_title="$(head -1 ${article_file} | awk -F'<h1>' '{print $2}' | awk -F'</h1>' '{print $1}')"
|
|
||||||
|
|
||||||
#echo "* [${_article_title}](${chapter_dir_in_article}/${article_html_file})" >> ${INDEX_MD}
|
|
||||||
if [ X"${hide_article_in_index}" == X'NO' ]; then
|
if [ X"${hide_article_in_index}" == X'NO' ]; then
|
||||||
echo "* [${_article_title}](${article_html_file})" >> ${INDEX_MD}
|
echo "* [${_article_title}](${article_html_file})" >> ${INDEX_MD}
|
||||||
fi
|
fi
|
||||||
|
@ -115,7 +111,7 @@ for chapter_dir in ${all_chapter_dirs}; do
|
||||||
compile_this_file="$?"
|
compile_this_file="$?"
|
||||||
|
|
||||||
if [ X"${compile_this_file}" == X'0' -o X"${compile_all}" == X'YES' ]; then
|
if [ X"${compile_this_file}" == X'0' -o X"${compile_all}" == X'YES' ]; then
|
||||||
echo -e "\n* Converting: ${article_file}"
|
echo -e "\n* Converting (#${article_counter}): ${article_file}"
|
||||||
${CMD_CONVERT} ${article_file} ${OUTPUT_DIR} \
|
${CMD_CONVERT} ${article_file} ${OUTPUT_DIR} \
|
||||||
output_filename="${article_html_file}" \
|
output_filename="${article_html_file}" \
|
||||||
title="${_article_title}" \
|
title="${_article_title}" \
|
||||||
|
|
|
@ -112,6 +112,16 @@ OpenLDAP is configured to log to `/var/log/openldap.log` by default, if it's
|
||||||
empty, please check normal syslog log file `/var/log/messages` or
|
empty, please check normal syslog log file `/var/log/messages` or
|
||||||
`/var/log/syslog` instead.
|
`/var/log/syslog` instead.
|
||||||
|
|
||||||
|
## MySQL, MariaDB
|
||||||
|
|
||||||
|
Main config file:
|
||||||
|
|
||||||
|
* on RHEL/CentOS: `/etc/my.cnf.
|
||||||
|
* on Debian/Ubuntu, it's `/etc/mysql/my.cnf`. If you're running MariaDB, it's
|
||||||
|
`/etc/mysql/mariadb.conf.d/mysqld.cnf`.
|
||||||
|
* on FreeBSD: `/var/db/mysql/my.cnf`.
|
||||||
|
* on OpenBSD: `/etc/my.cnf.
|
||||||
|
|
||||||
## Amavisd
|
## Amavisd
|
||||||
|
|
||||||
### Main config files
|
### Main config files
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Log executed SQL commands in MySQL/MariaDB</title>
|
||||||
|
<link href="./css/markdown.css" rel="stylesheet"></head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="navigation">
|
||||||
|
<a href="http://www.iredmail.org" target="_blank">iRedMail web site</a>
|
||||||
|
|
||||||
|
// <a href="./index.html">Document Index</a>
|
||||||
|
</div><h1 id="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:
|
||||||
|
<a href="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><p style="text-align: center; color: grey;">Document published under a <a href="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 <a href="http://www.iredmail.org/contact.html">contact us</a> to fix it.<script>
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', 'UA-3293801-21', 'auto');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
</script>
|
||||||
|
</body></html>
|
|
@ -27,6 +27,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#openldap">OpenLDAP</a></li>
|
<li><a href="#openldap">OpenLDAP</a></li>
|
||||||
|
<li><a href="#mysql-mariadb">MySQL, MariaDB</a></li>
|
||||||
<li><a href="#amavisd">Amavisd</a><ul>
|
<li><a href="#amavisd">Amavisd</a><ul>
|
||||||
<li><a href="#main-config-files_1">Main config files</a></li>
|
<li><a href="#main-config-files_1">Main config files</a></li>
|
||||||
<li><a href="#log-files_2">Log files</a></li>
|
<li><a href="#log-files_2">Log files</a></li>
|
||||||
|
@ -156,6 +157,15 @@
|
||||||
<p>OpenLDAP is configured to log to <code>/var/log/openldap.log</code> by default, if it's
|
<p>OpenLDAP is configured to log to <code>/var/log/openldap.log</code> by default, if it's
|
||||||
empty, please check normal syslog log file <code>/var/log/messages</code> or
|
empty, please check normal syslog log file <code>/var/log/messages</code> or
|
||||||
<code>/var/log/syslog</code> instead.</p>
|
<code>/var/log/syslog</code> instead.</p>
|
||||||
|
<h2 id="mysql-mariadb">MySQL, MariaDB</h2>
|
||||||
|
<p>Main config file:</p>
|
||||||
|
<ul>
|
||||||
|
<li>on RHEL/CentOS: `/etc/my.cnf.</li>
|
||||||
|
<li>on Debian/Ubuntu, it's <code>/etc/mysql/my.cnf</code>. If you're running MariaDB, it's
|
||||||
|
<code>/etc/mysql/mariadb.conf.d/mysqld.cnf</code>.</li>
|
||||||
|
<li>on FreeBSD: <code>/var/db/mysql/my.cnf</code>.</li>
|
||||||
|
<li>on OpenBSD: `/etc/my.cnf.</li>
|
||||||
|
</ul>
|
||||||
<h2 id="amavisd">Amavisd</h2>
|
<h2 id="amavisd">Amavisd</h2>
|
||||||
<h3 id="main-config-files_1">Main config files</h3>
|
<h3 id="main-config-files_1">Main config files</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -123,6 +123,7 @@
|
||||||
<li><a href="debug.cluebringer.html">Turn on debug mode in Cluebringer</a></li>
|
<li><a href="debug.cluebringer.html">Turn on debug mode in Cluebringer</a></li>
|
||||||
<li><a href="debug.dovecot.html">Turn on debug mode in Dovecot</a></li>
|
<li><a href="debug.dovecot.html">Turn on debug mode in Dovecot</a></li>
|
||||||
<li><a href="debug.iredapd.html">Turn on debug mode in iRedAPD</a></li>
|
<li><a href="debug.iredapd.html">Turn on debug mode in iRedAPD</a></li>
|
||||||
|
<li><a href="debug.mysql.html">Log executed SQL commands in MySQL/MariaDB</a></li>
|
||||||
<li><a href="debug.openldap.html">Turn on debug mode in OpenLDAP</a></li>
|
<li><a href="debug.openldap.html">Turn on debug mode in OpenLDAP</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 id="frequently-asked-questions">Frequently Asked Questions</h3>
|
<h3 id="frequently-asked-questions">Frequently Asked Questions</h3>
|
||||||
|
|
|
@ -138,7 +138,7 @@ SSLCertificateChainFile /etc/pki/tls/certs/server.ca-bundle
|
||||||
listen 443;
|
listen 443;
|
||||||
...
|
...
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate /etc/pki/tls/server.crt;
|
ssl_certificate /etc/pki/tls/certs/server.crt;
|
||||||
ssl_certificate_key /etc/pki/tls/private/server.key;
|
ssl_certificate_key /etc/pki/tls/private/server.key;
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ certificates in the combined file:</p>
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Then update <code>ssl_certificate</code> parameter in <code>/etc/nginx/conf.d/default.conf</code>:</p>
|
<p>Then update <code>ssl_certificate</code> parameter in <code>/etc/nginx/conf.d/default.conf</code>:</p>
|
||||||
<pre><code> ssl_certificate /etc/pki/tls/server.chained.crt;
|
<pre><code> ssl_certificate /etc/pki/tls/certs/server.chained.crt;
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Restarting Nginx service is required.</p>
|
<p>Restarting Nginx service is required.</p>
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Log executed SQL commands in MySQL/MariaDB
|
||||||
|
|
||||||
|
> Don't know where MySQL config file is? check this tutorial:
|
||||||
|
> [Locations of configuration and log files of mojor components](file.locations.html#mysql-mariadb).
|
||||||
|
|
||||||
|
To log executed SQL commands, please add below two settings in MySQL/MariaDB
|
||||||
|
config file `my.cnf`:
|
||||||
|
|
||||||
|
```
|
||||||
|
[mysqld]
|
||||||
|
general_log = 1
|
||||||
|
general_log_file = /var/log/mysql.log
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart MySQL/MariaDB service.
|
||||||
|
|
||||||
|
Note: MySQL/MariaDB daemon user must have permission to write this log file.
|
Loading…
Reference in New Issue