diff options
-rwxr-xr-x | docs/CHANGELOG.md | 1 | ||||
-rw-r--r-- | lib/install.lib.php | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4205971a..6e2bd9c6 100755 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ CHANGELOG 3.6-FUTURE ---------- +- Added support for MySQL sockets (based on patches by randomessence) - Fixed some issues with the logic around memory_limit (reported by CableNinja) - Fixed issue that sometimes removed ratings after catalog operations (reported by stebe) diff --git a/lib/install.lib.php b/lib/install.lib.php index a889d65d..899e4925 100644 --- a/lib/install.lib.php +++ b/lib/install.lib.php @@ -155,9 +155,13 @@ function install_insert_db($db_user = null, $db_pass = null, $overwrite = false) // Check to see if we should create a user here if (strlen($db_user) && strlen($db_pass)) { - $sql = 'GRANT ALL PRIVILEGES ON `' . Dba::escape($database) . '`.* TO ' . - "'" . Dba::escape($db_user) . "'@'" . Dba::escape(Config::get('database_hostname')) . "' IDENTIFIED BY '" . Dba::escape($db_pass) . "' WITH GRANT OPTION"; - + $db_host = Config::get('database_hostname'); + if (strpos($db_host, '/') === 0) { + $db_host = 'localhost'; + } + $sql = 'GRANT ALL PRIVILEGES ON `' . Dba::escape($database) . '`.* TO ' . + "'" . Dba::escape($db_user) . "'@'" . Dba::escape($db_host) . "' " . + "IDENTIFIED BY '" . Dba::escape($db_pass) . "' WITH GRANT OPTION"; if (!Dba::write($sql)) { Error::add('general', sprintf(T_('Error: Unable to Insert %1$s with permissions to %2$s on %3$s %4$s'), $db_user, $database, $hostname, Dba::error())); return false; |