- // Before we blindly try to create a user that already has access,
- try { // first attempt to connect to the database
- new DatabaseMysql(
- $server,
- $dbUser,
- $password,
- false,
- false,
- 0,
- $this->getVar( 'wgDBprefix' )
- );
+ if ( $this->getVar( '_CreateDBAccount' ) ) {
+ // Before we blindly try to create a user that already has access,
+ try { // first attempt to connect to the database
+ new DatabaseMysql(
+ $server,
+ $dbUser,
+ $password,
+ false,
+ false,
+ 0,
+ $this->getVar( 'wgDBprefix' )
+ );
+ $grantableNames[] = $this->buildFullUserName( $dbUser, $server );
+ $tryToCreate = false;
+ } catch ( DBConnectionError $e ) {
+ $tryToCreate = true;
+ }
+ } else {