You need the MySQL / MariaDB header files, as well as the shared library libmysqlclient.so / libmariadb.so. Depending on your Linux distribution, you may need to install a package which is usually called "mysql-devel" or "mariadb-devel".
Это для windows How to Build the QMYSQL Plugin on Windows
You need to get the MySQL installation files (e.g. mysql-installer-web-community-8.0.18.0.msi) or mariadb-connector-c-3.1.5-win64.msi. Run the installer, select custom installation and install the MySQL C Connector which matches your Qt installation (x86 or x64). After installation check that the needed files are there: