Note: to use mysql with Debian GNU/Linux's Postfix, all you
need is to install the postfix-mysql package and you're done.
There is no need to recompile Postfix.
The Postfix MySQL client utilizes the mysql client library,
which can be obtained from:
https://www.mysql.com/downloads/
https://sourceforge.net/projects/mysql/
In order to build Postfix with mysql map support, you will need to add
-DHAS_MYSQL and -I for the directory containing the mysql headers, and
the mysqlclient library (and libm) to AUXLIBS, for example:
make -f Makefile.init makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm'
On Solaris, use this instead:
make -f Makefile.init makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib \
-lmysqlclient -lz -lm'
Then, just run 'make'. This requires libz, the compression
library. Older mysql implementations build without libz.