How to fix "Cannot find 'mariadb_config' or 'mysql_config'" errors
The self-hosted edition of our MIDAS room booking software has a number of server requirements.MIDAS requires both Perl and a database (either MySQL or MariaDB).
Communication between Perl and the backend database is via a Perl Module - either DBD::mysql or DBD::MariaDB.
Either of these two modules must be present within your Perl installation in order to be able to install and use MIDAS.
Whilst your Perl installation may already come with one or both of these modules installed, if they are not present, then it's relatively forward to install additional Perl modules.
However, when installing DBD::MariaDB you may encouter the following errors:
Cannot find the file 'mariadb_config' nor 'mysql_config'! Your execution PATH doesn't seem not contain the path to mariadb_config or mysql_config. Resorting to guessed values!
Failed to determine directory of MySQL.h
What causes "Cannot find the file 'mariadb_config' nor 'mysql_config'" errors?
These errors can be encounted when attempting to install DBD::MariaDB under the latest versions of Strawberry Perl (i.e. v5.40).
They're caused because Strawberry Perl 5.40 doesn't include the necessary MySQL library files ('libmysql'), which are required for connections between Strawberry Perl and MySQL/MariaDB servers. Previous versions of Strawberry Perl have included this library.
How to resolve "Cannot find the file 'mariadb_config' nor 'mysql_config'" errors
The good news is that the missing MySQL library in Strawberry Perl 5.40 can be easily 'copied over' from the previous version of Strawberry Perl. Doing so then resolves the errors about missing config files.
So here's what you'll need to do:
- First of all, you'll need to download the portable edition of Strawberry Perl 5.38.2 via this link.
- You'll then need to copy some files from this .zip file across to your existing Strawberry Perl 5.40 installation, namely:
- Copy mysql_config.bat from SP-5.38.2/c/bin to SP-5.40.0/c/bin
- Copy libmysql__.dll from SP-5.38.2/c/bin to SP-5.40.0/c/bin
- Copy libmysql.a from SP-5.38.2/c/lib to SP-5.40.0/c/lib
- Copy the mysql50716 folder from SP-5.38.2/c/include to SP-5.40.0/c/include
- You can then install DBD::MariaDB, however, you'll need to install v1.22 of this module (rather than the latest version, which at time of writing is v1.23). This is because version 1.23 of the DBD::MariaDB module won't build against the MySQL library from Strawberry Perl 5.38.2. If you try, you'll encounter "the symbol '__imp___pioinfo' can't be resolved" or "Undefined reference to '__imp___pioinfo'" errors.
- So to install DBD::MariaDB v1.22, run the following:
cpan> cpan P/PA/PALI/DBD-MariaDB-1.22.tar.gz
The DBD::MariaDB module should then successfully install!
← Return to the Knowledge Base