## Error Messages
``` 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> ^ ```
## Environment
Ubuntu-14.04 Kamailio-4.3.3 libmysqlclient-dev-5.7.9
``` bash $ mysql_config --include -I/usr/include/mysql ```
## Possible Causes
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.
## Possible Fixes
Add the original include path created by mysql_config:
```diff diff --git a/modules/db_mysql/Makefile b/modules/db_mysql/Makefile index 1cea920..ea6ccac 100644 --- a/modules/db_mysql/Makefile +++ b/modules/db_mysql/Makefile @@ -20,7 +20,8 @@ endif
ifneq ($(MYSQLCFG),) # use autodetection - DEFS += $(shell $(MYSQLCFG) --include | sed 's/(-I[^ ]*)/mysql/\1/g' ) + DEFS += $(shell $(MYSQLCFG) --include | sed 's/(-I[^ ]*)/mysql/\1/g' ) \ + $(shell $(MYSQLCFG) --include LIBS = $(shell $(MYSQLCFG) --libs) else ```
Or, apply the above patch when mysql's version >= 5.7, assuming it only occurs in mysql 5.7.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/419
Thank you for reporting and extensive explanation. I will look at it and see what is the best option. I think we should get rid of that removal of 'mysql' in the include path computed inside the Makefile.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/419#issuecomment-159960674
Closed #419.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/419#event-475914258
Pushed commit 2bd85c6b5020929296860074ca9a5dbc0cbde69c to master. If no issues will be noticed, it will be backported.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/419#issuecomment-160003117
Thanks for the quick fixes!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/419#issuecomment-160032334