Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Professional Edition
-
None
-
php8.0
Description
Hello,
On fresh Debian 11 installation, the file /etc/mysql/debian.cnf have new multiline header :
THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE.
|
This file exists only for backwards compatibility for |
tools that run '--defaults-file=/etc/mysql/debian.cnf' |
and have root level access to the local filesystem.
|
With those permissions one can run 'mariadb' directly |
anyway thanks to unix socket authentication and hence
|
this file is useless. See package README for more info. |
The current preg_replace fail to parse correctly this file :
var_dump($mysql_ini); |
string(544) "; THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE.
|
# This file exists only for backwards compatibility for |
# tools that run '--defaults-file=/etc/mysql/debian.cnf' |
# and have root level access to the local filesystem. |
# With those permissions one can run 'mariadb' directly |
# anyway thanks to unix socket authentication and hence |
# this file is useless. See package README for more info. |
We need to add "m" flag on preg_replace :
$mysql_ini = preg_replace('/^\s*#/m', ';', file_get_contents('/etc/mysql/debian.cnf')); |
var_dump($mysql_ini); |
string(544) "; THIS FILE IS OBSOLETE. STOP USING IT IF POSSIBLE.
|
; This file exists only for backwards compatibility for |
; tools that run '--defaults-file=/etc/mysql/debian.cnf' |
; and have root level access to the local filesystem. |
; With those permissions one can run 'mariadb' directly |
; anyway thanks to unix socket authentication and hence |
; this file is useless. See package README for more info. |