title: How can I connect rSyslog to an SQL database?
body: <p>I'm trying to connect rsyslog to a remote SQL database. Here's (part of) my /etc/rsyslog.conf:</p>
  
  <pre><code>$ModLoad ommysql
  *.* action(type="ommysql" server="logs.example.com" serverport="3306" db="logs" uid="..." pwd="...")
  </code></pre>
  
  <p>I can send logging messages to the terminal and /var/log/messages by doing <code>logger -s "test message"</code>, but they don't appear in the database. I have installed rsyslog-mysql and mysql is installed on the machine as well. Here's what I've tried so far:</p>
  
  <ul>
  <li>I looked in /var/log/messages after restarting rsyslog to see if it was failing to start or to parse the config file (it's doing fine).</li>
  <li>I connected to the database using the <code>mysql</code> command - the user exists and can connect to the server, and it has the right permissions.</li>
  <li>I used <code>tcpdump</code> to listen to traffic going to port 3306. There is none when I use <code>logging</code>, but I can see traffic when I connect with <code>mysql</code>, whether I get the password right or not.</li>
  </ul>
  
  <p>This is on CentOS 6.5 with rsyslog 5.8.10.</p>