title: PhpMyAdmin - can localhost access be recovered?
body: <p>Using nothing but stupidity I've managed to delete localhost access from my MySql database, so PhpMyAdmin won't run, although a simple example script still runs fine. I only started using it in anger yesterday, so would appreciate a little help?</p>
  
  <pre><code>{
   phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
  }
  </code></pre>
  
  <p>This is a snippet of the working prog, from the W3C site, it works with any valid user and fails the others. Why can't phpmyadmin run, and what config file has been rewritten?</p>
  
  <pre><code>{
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname = "sql_learn";
  
  try {
  $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username,$password);
  $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  $stmt = $conn-&gt;prepare("SELECT _id, _gibb FROM gibberish");
  $stmt-&gt;execute();
  
  // set the resulting array to associative
  $result = $stmt-&gt;setFetchMode(PDO::FETCH_ASSOC);
  foreach(new TableRows(new RecursiveArrayIterator($stmt-&gt;fetchAll())) as $k=&gt;$v) {
      echo $v;
  }
  </code></pre>