File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
modules/setup/application/forms Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,18 @@ protected function assemble(): void
133133 . ' that has the appropriate credentials to resolve this issue. '
134134 ),
135135 implode (', ' , $ mm ->getRequiredDatabasePrivileges ())
136+ ))),
137+ new HtmlElement ('br ' ),
138+ new HtmlElement ('br ' ),
139+ new HtmlElement ('span ' , null , Text::create (sprintf (
140+ $ this ->translate (
141+ 'The database name may contain either an underscore or a percent sign. '
142+ . ' In MySQL these characters represent a wildcard. If part of a database name, '
143+ . ' they might not have been escaped when manually granting privileges. '
144+ . ' Privileges might not be detected in this case. Check the documentation and '
145+ . ' update your grants accordingly: %s '
146+ ),
147+ 'https://dev.mysql.com/doc/refman/8.0/en/grant.html#grant-quoting '
136148 )))
137149 )
138150 );
Original file line number Diff line number Diff line change @@ -91,6 +91,19 @@ public function setDatabaseUsagePrivileges(array $privileges)
9191 */
9292 public function createElements (array $ formData )
9393 {
94+ if ($ this ->config ['db ' ] === 'mysql ' && preg_match ('/[_%]/ ' , $ this ->config ['dbname ' ])) {
95+ $ this ->warning (sprintf (
96+ $ this ->translate (
97+ 'The database name may contain either an underscore or a percent sign. '
98+ . ' In MySQL these characters represent a wildcard. If part of a database name, '
99+ . ' they might not have been escaped when manually granting privileges. '
100+ . ' Privileges might not be detected in this case. Check the documentation and '
101+ . ' update your grants accordingly: %s '
102+ ),
103+ 'https://dev.mysql.com/doc/refman/8.0/en/grant.html#grant-quoting '
104+ ));
105+ }
106+
94107 $ skipValidation = isset ($ formData ['skip_validation ' ]) && $ formData ['skip_validation ' ];
95108 $ this ->addElement (
96109 'text ' ,
You can’t perform that action at this time.
0 commit comments