Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Default mysql admin user to root
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed May 13, 2015
1 parent ae88eab commit 9661a2e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions base/DatabaseInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,8 @@ public function installDatabase(): bool {
}

private function getRootConnection(): resource {
print "MySQL admin user (probably 'root'): ";
$this->username = trim(fgets(STDIN));
if (!$this->username) {
throw new Exception(
'Invalid user - set up the wp_bench database and user manually.'
);
}
print "MySQL admin user (default is 'root'): ";
$this->username = trim(fgets(STDIN)) ?: 'root';
fprintf(STDERR, '%s', 'MySQL admin password: ');
$this->password = trim(fgets(STDIN));
$conn = mysql_connect('127.0.0.1', $this->username, $this->password);
Expand Down

0 comments on commit 9661a2e

Please sign in to comment.