@@ -142,14 +142,15 @@ public static function reorderMigrationRows(array $output) : array
142
142
*/
143
143
private static function mysqlSchemaDump (array $ db_config , string $ schema_sql_path ) : int
144
144
{
145
- // TODO: Suppress warning about insecure password.
146
145
// CONSIDER: Intercepting stdout and stderr and converting to colorized
147
146
// console output with `$this->info` and `->error`.
148
147
passthru (
149
- static ::mysqlCommandPrefix ($ db_config )
148
+ 'bash -c " '
149
+ . static ::mysqlCommandPrefix ($ db_config )
150
150
. ' --result-file= ' . escapeshellarg ($ schema_sql_path )
151
151
. ' --no-data '
152
- . ' --routines ' ,
152
+ . ' --routines '
153
+ . ' 2> >(grep -v \'Using a password on the command line interface can be insecure. \')" ' ,
153
154
$ exit_code
154
155
);
155
156
@@ -170,13 +171,15 @@ private static function mysqlSchemaDump(array $db_config, string $schema_sql_pat
170
171
171
172
// Include migration rows to avoid unnecessary reruns conflicting.
172
173
exec (
173
- static ::mysqlCommandPrefix ($ db_config )
174
+ 'bash -c " '
175
+ . static ::mysqlCommandPrefix ($ db_config )
174
176
. ' ' . ($ db_config ['prefix ' ] ?? '' ) . 'migrations '
175
177
. ' --no-create-info '
176
178
. ' --skip-extended-insert '
177
179
. ' --skip-routines '
178
180
. ' --single-transaction '
179
- . ' --compact ' ,
181
+ . ' --compact '
182
+ . ' 2> >(grep -v \'Using a password on the command line interface can be insecure. \')" ' ,
180
183
$ output ,
181
184
$ exit_code
182
185
);
@@ -207,11 +210,13 @@ private static function mysqlSchemaDump(array $db_config, string $schema_sql_pat
207
210
private static function mysqlDataDump (array $ db_config , string $ data_sql_path ) : int
208
211
{
209
212
passthru (
210
- static ::mysqlCommandPrefix ($ db_config )
213
+ 'bash -c " '
214
+ . static ::mysqlCommandPrefix ($ db_config )
211
215
. ' --result-file= ' . escapeshellarg ($ data_sql_path )
212
216
. ' --no-create-info --skip-routines --skip-triggers '
213
217
. ' --ignore-table= ' . escapeshellarg ($ db_config ['database ' ] . '. ' . ($ db_config ['prefix ' ] ?? '' ) . 'migrations ' )
214
- . ' --single-transaction ' , // Avoid disruptive locks.
218
+ . ' --single-transaction ' // Avoid disruptive locks.
219
+ . ' 2> >(grep -v \'Using a password on the command line interface can be insecure. \')" ' ,
215
220
$ exit_code
216
221
);
217
222
0 commit comments