Index: src/modules/db_mysql/my_cmd.c
--- src/modules/db_mysql/my_cmd.c.orig
+++ src/modules/db_mysql/my_cmd.c
@@ -24,7 +24,7 @@
  */
 
 /* the following macro will break the compile on solaris */
-#if !defined (__SVR4) && !defined (__sun)
+#if !defined (__SVR4) && !defined (__sun) && !defined (__OpenBSD__)
 #define _XOPEN_SOURCE 4     /* bsd */
 #endif
 #define _XOPEN_SOURCE_EXTENDED 1    /* solaris */
@@ -45,6 +45,7 @@
 
 #include <strings.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <time.h>  /*strptime, XOPEN issue must be >=4 */
 #include <string.h>
 #include <errmsg.h>
