Skip to content

Commit 9a25176

Browse files
committed
MySQL: allow empty host
1 parent d9e118f commit 9a25176

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

adminer/drivers/mysql.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ function attach(string $server, string $username, string $password): string {
177177
}
178178
list($host, $port) = host_port($server);
179179
return $this->dsn(
180-
"mysql:charset=utf8;host=$host" . ($port ? (is_numeric($port) ? ";port=" : ";unix_socket=") . $port : ""),
180+
"mysql:charset=utf8".(!empty($host) ? ";host=$host" : '') . ($port ? (is_numeric($port) ? ";port=" : ";unix_socket=") . $port : ""),
181181
$username,
182182
$password,
183183
$options

0 commit comments

Comments
 (0)