diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index 7f9c1a2fc4b9d5aa01dd7d740e0059ce66fbf76b..b323c970a9dca08ef330c5c439aa0dbbb51faee0 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -541,16 +541,20 @@ if (! $error && $db->connected && $action == "set")
             {
                 if ($db->connected)
                 {
+                    $resultbis = 1;
+                    
                     // Create user
-                    $tmpdolibarr_main_db_host = $dolibarr_main_db_host;
+                    $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
+                    // Create user bis
                     if ($databasefortest == 'mysql')
                     {
-                        if (! in_array($conf->db->host, array('127.0.0.1', 'localhost', 'localhost.local'))) $tmpdolibarr_main_db_host='%';
+                        if (! in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local')))
+                        {
+                            $resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
+                        }
                     }
                     
-                    $result=$db->DDLCreateUser($tmpdolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
-
-                    if ($result > 0)
+                    if ($result > 0 && $resultbis > 0)
                     {
 
                         print '<tr><td>';