Skip to content

Commit

Permalink
Don't make use call when database is empty (#13701)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasruiz authored and taylorotwell committed May 25, 2016
1 parent 6f95210 commit 3fed0f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Connectors/MySqlConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public function connect(array $config)
// connection's behavior, and some might be specified by the developers.
$connection = $this->createConnection($dsn, $config, $options);

$connection->exec("use `{$config['database']}`;");
if (isset($config['database'])) {
$connection->exec("use `{$config['database']}`;");
}

$collation = $config['collation'];

Expand Down

0 comments on commit 3fed0f1

Please sign in to comment.