mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
Add port to DSN
This commit is contained in:
@@ -55,10 +55,11 @@ class CreateDatabase extends Command
|
|||||||
{
|
{
|
||||||
if ('mysql' !== env('DB_CONNECTION')) {
|
if ('mysql' !== env('DB_CONNECTION')) {
|
||||||
$this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION')));
|
$this->info(sprintf('CreateDB does not apply to "%s", skipped.', env('DB_CONNECTION')));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// try to set up a raw connection:
|
// try to set up a raw connection:
|
||||||
$dsn = sprintf('mysql:host=%s;charset=utf8mb4', env('DB_HOST'));
|
$dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST'), env('DB_PORT'));
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
Reference in New Issue
Block a user