@@ -142,14 +142,15 @@ public static function reorderMigrationRows(array $output) : array
142142 */
143143 private static function mysqlSchemaDump (array $ db_config , string $ schema_sql_path ) : int
144144 {
145- // TODO: Suppress warning about insecure password.
146145 // CONSIDER: Intercepting stdout and stderr and converting to colorized
147146 // console output with `$this->info` and `->error`.
148147 passthru (
149- static ::mysqlCommandPrefix ($ db_config )
148+ 'bash -c " '
149+ . static ::mysqlCommandPrefix ($ db_config )
150150 . ' --result-file= ' . escapeshellarg ($ schema_sql_path )
151151 . ' --no-data '
152- . ' --routines ' ,
152+ . ' --routines '
153+ . ' 2> >(grep -v \'Using a password on the command line interface can be insecure. \')" ' ,
153154 $ exit_code
154155 );
155156
@@ -170,13 +171,15 @@ private static function mysqlSchemaDump(array $db_config, string $schema_sql_pat
170171
171172 // Include migration rows to avoid unnecessary reruns conflicting.
172173 exec (
173- static ::mysqlCommandPrefix ($ db_config )
174+ 'bash -c " '
175+ . static ::mysqlCommandPrefix ($ db_config )
174176 . ' ' . ($ db_config ['prefix ' ] ?? '' ) . 'migrations '
175177 . ' --no-create-info '
176178 . ' --skip-extended-insert '
177179 . ' --skip-routines '
178180 . ' --single-transaction '
179- . ' --compact ' ,
181+ . ' --compact '
182+ . ' 2> >(grep -v \'Using a password on the command line interface can be insecure. \')" ' ,
180183 $ output ,
181184 $ exit_code
182185 );
@@ -207,11 +210,13 @@ private static function mysqlSchemaDump(array $db_config, string $schema_sql_pat
207210 private static function mysqlDataDump (array $ db_config , string $ data_sql_path ) : int
208211 {
209212 passthru (
210- static ::mysqlCommandPrefix ($ db_config )
213+ 'bash -c " '
214+ . static ::mysqlCommandPrefix ($ db_config )
211215 . ' --result-file= ' . escapeshellarg ($ data_sql_path )
212216 . ' --no-create-info --skip-routines --skip-triggers '
213217 . ' --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. \')" ' ,
215220 $ exit_code
216221 );
217222
0 commit comments