Skip to content

Commit b09a45a

Browse files
Merge pull request #1668 from wp-cli/mysql-no-hash
Use `mysql` with `--no-auto-rehash` for perf boost
2 parents 357e4b7 + 9edc5e3 commit b09a45a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

php/commands/db.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function repair() {
7878
* @alias connect
7979
*/
8080
function cli() {
81-
self::run( 'mysql --no-defaults', array(
81+
self::run( 'mysql --no-defaults --no-auto-rehash', array(
8282
'database' => DB_NAME
8383
) );
8484
}
@@ -109,7 +109,7 @@ function query( $args ) {
109109
$assoc_args['execute'] = $args[0];
110110
}
111111

112-
self::run( 'mysql --no-defaults', $assoc_args );
112+
self::run( 'mysql --no-defaults --no-auto-rehash', $assoc_args );
113113
}
114114

115115
/**
@@ -192,7 +192,7 @@ function import( $args, $assoc_args ) {
192192
);
193193
}
194194

195-
self::run( 'mysql --no-defaults', array(
195+
self::run( 'mysql --no-defaults --no-auto-rehash', array(
196196
'database' => DB_NAME
197197
), $descriptors );
198198

@@ -244,7 +244,7 @@ private static function get_create_query() {
244244
}
245245

246246
private static function run_query( $query ) {
247-
self::run( 'mysql --no-defaults', array( 'execute' => $query ) );
247+
self::run( 'mysql --no-defaults --no-auto-rehash', array( 'execute' => $query ) );
248248
}
249249

250250
private static function run( $cmd, $assoc_args = array(), $descriptors = null ) {

0 commit comments

Comments
 (0)