title: Access denied for user 'apache'@'localhost' (using password: NO)
body: <p>I have installed LAMP in CentOS 7 </p>
  
  <p>When I placed my files in the default directory (var/www/html in my case)
  I receive the following when I access my page:</p>
  
  <blockquote>
    <p>Erreur : PB de connexion au serveur mysql de la langue : fr
    Erreur : PB de connexion � la base de donn�es de la langue : fr
    Erreur SQL : SELECT * FROM parametres
    Access denied for user 'apache'@'localhost' (using password: NO)</p>
  </blockquote>
  
  <p>The following is my config file:</p>
  
  <pre><code>$action  = "action";
  
  
  @error_reporting (E_ALL);
  @setlocale(LC_TIME, 'french');
  
  
  $host     = "localhost";
  
  $user     = "";
  $password = ""    ;
  
  
   //---&gt; La langue utilisée (fr, en, ar)
   global $lang ;
   $lang             = isset($_REQUEST["lang"])? $_REQUEST["lang"] : "";
   switch($lang)
   {
   case "ar"  :  $lang = "ar" ; break;
   case "en"  : $lang = "en" ; break;
   case "fr"   :  $lang = "fr" ; break;
   default        : $lang = "fr" ; //---&gt; La langue par défaut
   } //Fin switch
  
  
  
  
  
   global $lang_param;
  
  $lang_param = array
            (
              //---&gt; principal = TRUE
               "fr" =&gt; array(
                             "host"        =&gt; "localhost"         ,
                             "db"          =&gt; "database_fr"             ,
                             "user"        =&gt; "user1"              ,
                             "password"    =&gt; ""                  ,
                             "chemin"      =&gt; "fr"                ,
                             "description" =&gt; "Langue française"  ,
                             "short"       =&gt; "Fran&amp;ccedil;ais"          ,
                           ),
                           //---&gt; principal = FALSE
             "en" =&gt; array(
                             "host"        =&gt; "localhost"         ,
                             "db"          =&gt; "database_en"           ,
                             "user"        =&gt; "user1"              ,
                             "password"    =&gt; ""                  ,
                             "chemin"      =&gt; "en"                ,
                             "description" =&gt; "Langue anglaise"   ,
                             "short"       =&gt; "Anglais"           ,
                           )  ,
  
  
               "ar" =&gt; array(
                             "host"        =&gt; "localhost"         ,
                             "db"          =&gt; "database_ar"             ,
                             "user"        =&gt; "user1"              ,
                             "password"    =&gt; ""                  ,
                             "chemin"      =&gt; "ar"                ,
                             "description" =&gt; "Langue arabe"  ,
                             "short"       =&gt; "Arabe"          ,
                           )           
  
  
            ); //Fin $lang_param
  
  
  
  
  //---&gt; Se connecter
  $r = @mysql_pconnect($lang_param[$lang]["host"], $lang_param[$lang]       ["user"], $lang_param[$lang]["password"]); 
  if ($r==0) 
  {
   echo "Erreur : PB de connexion au serveur mysql de la langue :    $lang&lt;br&gt;";
   } //Fsi
  
    $r = @mysql_select_db($lang_param[$lang]["db"]);
   if ($r==0) {
     echo "Erreur : PB de connexion à la base de données de la langue : $lang&lt;br&gt;";
    } //Fsi
  </code></pre>
  
  <p>How can I gain access for apache@localhost?</p>