Skip to content

Commit 4b221f4

Browse files
committed
Fix: php artisan db command if no password
If there is no password in the database connection, it will not be connected and an error will be thrown.
1 parent fba3b98 commit 4b221f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Console/DbCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected function getMysqlArguments(array $connection)
162162
'--port='.$connection['port'],
163163
'--user='.$connection['username'],
164164
], $this->getOptionalArguments([
165-
'password' => '--password='.$connection['password'],
165+
$connection['password'] ? 'password' => '--password='.$connection['password'] : '',
166166
'unix_socket' => '--socket='.($connection['unix_socket'] ?? ''),
167167
'charset' => '--default-character-set='.($connection['charset'] ?? ''),
168168
], $connection), [$connection['database']]);

0 commit comments

Comments
 (0)