MariaDB service fails to start (my.ini variable names)
Posted by: wampSuter (---.adslplus.ch)
Date: November 30, 2022 08:26AM

Hi everyone

Not sure if this is a bug, but my MariaDB version 10.4.10 would not start if the script `refreshMariadb.php` gets executed (WampServer 3.2.9). This is because in lines 209-227 there is a part which converts all my.ini-variables from "dashed" to "underscored" versions. Like for example
"default-storage-engine=" to "default_storage_engine=".

Workaround. I have commented out line 224.

Is this a problem with older MariaDB versions only?

Best regards
WampSuter



Edited 1 time(s). Last edit at 11/30/2022 09:01AM by wampSuter.

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: Otomatic (Moderator)
Date: November 30, 2022 10:14AM

Hi,

> Is this a problem with older MariaDB versions only?
May be

I need to look at which version MariaDB decided that it should be _ and not - for my.ini and change the conversion accordingly.

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40/8.0.31 - MariaDB 10.5.17/10.10.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



Edited 1 time(s). Last edit at 11/30/2022 11:28AM by Otomatic.

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: Otomatic (Moderator)
Date: November 30, 2022 11:29AM

Hi,

In MariaDB option file syntax it is indicated :

- Dashes (-) and underscores (_) in options are interchangeable.

There is no notion of version of MariaDB.

What is the exact and complete wording of the generated error?

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40/8.0.31 - MariaDB 10.5.17/10.10.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: wampSuter (---.adslplus.ch)
Date: November 30, 2022 08:46PM

Maybe that had been changed in a version after 10.4.10. There is no log entry at all, at least not for mariadb. I guess, that the service can not be started.

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: wampSuter (---.adslplus.ch)
Date: November 30, 2022 08:52PM

Wait, maybe I found the problem.

The directory the WampServer is installed contains "dashes". So in "my.ini" I do have

log-error="C:/Portable-Software/wamp64/logs/mariadb.log"

And the script changes that to

log_error="C:/Portable_Software/wamp64/logs/mariadb.log"

Note the underscore in "Portable_Software". Of course, this directory does not exist.

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: wampSuter (---.adslplus.ch)
Date: November 30, 2022 09:02PM

Indeed, that seems to be the problem.

If the option name contains a "dash", then the script changes all dashes into underscores. Not only for the option name, but also for the option value.

My workaround, I have manually changed all option names to use underscores.

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: Otomatic (Moderator)
Date: December 01, 2022 08:36AM

Hi,

Thank you very much for this bug finding!

I will change this to not replace - with _ in the parts to the right of the = sign

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40/8.0.31 - MariaDB 10.5.17/10.10.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: Otomatic (Moderator)
Date: December 01, 2022 11:06AM

Hi,

Fix is found:
In RefreshMariadb.php file:
line 217
Replace:
if(preg_match_all('~^;?[a-z]+-[a-z]+(?:-[a-z]*)*.*\r?$~mi',$myIniFileContents,$matches) > 0) {
by
if(preg_match_all('~^(;?[a-z]+-[a-z]+(?:-[a-z]*)*)=?.*\r?$~mi',$myIniFileContents,$matches) > 0) {
and line 219
Replace:
	foreach($matches[0] as $value) {
by
	foreach($matches[1] as $value) {

Do the same in RefreshMySQL.php but lines 233 and 235.

------------------------------------------------------------------------------------------------------------
Wampserver 3.3.0 32 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40 - MariaDB 10.5.13/10.6.5
Wampserver 3.3.0 64 bit - Apache 2.4.54.2 - PHP 8.2.0…7.4.33 - MySQL 5.7.40/8.0.31 - MariaDB 10.5.17/10.10.2
PhPMyadmin 5.2.0 - MysqlDumper 1.24.5
on W10 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: MariaDB service fails to start (my.ini variable names)
Posted by: wampSuter (---.93.63.188.dynamic.wline.res.cust.swisscom.ch)
Date: December 02, 2022 09:36AM

Thanks.

Options: ReplyQuote


Sorry, only registered users may post in this forum.