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.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



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?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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.