2016-06-21 1 views
0

私はMySqlデータベースからlocalhostアクセスを削除することができたので、PhpMyAdminは実行されませんが、単純なサンプルスクリプトは正常に動作します。私は昨日怒りでそれを使用し始めたので、少し助けていただければ幸いですか?PhpMyAdmin - ローカルホストのアクセスを回復できますか?

{ 
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. 
} 

これは、W3Cサイトのワーキングプログラムのスニペットであり、有効なユーザーと連携して動作し、他のユーザーは失敗します。 phpmyadminを実行できないのはなぜですか?どのような設定ファイルが書き直されましたか?

{ 
$servername = "localhost"; 
$username = "root"; 
$password = ""; 
$dbname = "sql_learn"; 

try { 
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username,$password); 
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
$stmt = $conn->prepare("SELECT _id, _gibb FROM gibberish"); 
$stmt->execute(); 

// set the resulting array to associative 
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC); 
foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) { 
    echo $v; 
} 
+0

アクセス権を削除しましたか? – Chay22

+0

私はこの「情報」メッセージで混乱し、ローカルホストの接続を切断しようとしました。悪いアイデア。 {localhostの任意のユーザーが接続できるユーザーアカウントが存在します。これにより、アカウントのホスト部分が任意の(%)ホストからの接続を許可する場合、他のユーザーが接続できなくなります。 –

答えて

1

私はあなたが何をしたか知っているか、または変更しましたが、あなたがXAMPPまたはWAMPのようなものを使用している場合、あなたは常にだけ./xampp/phpmyadminディレクトリに移動し、config.inc.phpconfig.sample.inc.phpの内容をコピーして記入することができませんあなたの設定。

+0

これはうまくいきました。 –

関連する問題