I need to reinvite https://bugreports.qt.io/browse/QTBUG-63796
Because the documentation does not work as expected
Especially if you add source via Qt Maintenance Tool and did not compile the whole git from scratch.
I also needed to mask QMAKE_USE += mysql in the mysql.pro file
and generate the make files with:
qmake INCLUDEPATH+=C:\pathto\mysql\include LIBS+=C:\pathto\mysql\lib\libmariadb.lib mysql.pro
after that nmake and nmake install works nicely.
Using MYSQL_INCDIR and MYSQL_LIBDIR like shown in the documentation does not work if you only try to add the mysql plugin afterwards.