<h2>Error Messages</h2>

<pre><code>In file included from /usr/include/mysql/mysql.h:64:0,
                 from km_dbase.c:36:
/usr/include/mysql/mysql/client_plugin.h:103:38: fatal error: mysql/plugin_auth_common.h: No such file or directory
 #include <mysql/plugin_auth_common.h>
                                      ^
</code></pre>

<h2>Environment</h2>

<p>Ubuntu-14.04<br>
Kamailio-4.3.3<br>
libmysqlclient-dev-5.7.9</p>

<div class="highlight highlight-source-shell"><pre>$ mysql_config --include
-I/usr/include/mysql</pre></div>

<h2>Possible Causes</h2>

<p>Makefile in modules/db_mysql will replace the string "-I/usr/include/mysql" to "-I/usr/include", the latter one will make the compilation fail but the former one won't. However it did not happen when compiling using mysql 5.6 or 5.5 etc. Not sure if there is anything changed in mysql 5.7.</p>

<h2>Possible Fixes</h2>

<p>Add the original include path created by mysql_config:</p>

<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/modules/db_mysql/Makefile b/modules/db_mysql/Makefile</span>
index 1cea920..ea6ccac 100644
<span class="pl-md">--- a/modules/db_mysql/Makefile</span>
<span class="pl-mi1">+++ b/modules/db_mysql/Makefile</span>
<span class="pl-mdr">@@ -20,7 +20,8 @@</span> endif

 ifneq ($(MYSQLCFG),)
        # use autodetection
<span class="pl-md">-       DEFS += $(shell $(MYSQLCFG) --include | sed 's/\(-I[^ ]*\)\/mysql/\1/g' )</span>
<span class="pl-mi1">+       DEFS += $(shell $(MYSQLCFG) --include | sed 's/\(-I[^ ]*\)\/mysql/\1/g' ) \</span>
<span class="pl-mi1">+               $(shell $(MYSQLCFG) --include</span>
        LIBS = $(shell $(MYSQLCFG) --libs)
 else</pre></div>

<p>Or, apply the above patch when mysql's version >= 5.7, assuming it only occurs in mysql 5.7.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/419">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZbJvPRK4lw7Prozhnz5X2DTYLWdhks5pJn5EgaJpZM4GptHu.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/419"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>