PhpMyAdmin - 本地主机访问是否可以恢复?
问题描述:
使用什么,但愚蠢我已经设法从我的MySql数据库中删除本地主机访问,所以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;
}
答
我不知道你做了什么或改变,但是如果你使用像XAMPP或WAMP你总是可以只是去./xampp/phpmyadmin
目录和config.sample.inc.php
的内容复制到config.inc.php
,并填写您的设置。
+0
工作,谢谢。 –
你是如何删除其访问权限的? – Chay22
我被这个'信息'消息弄糊涂了,并试图断开本地主机。馊主意。 {允许任何用户从本地主机连接的用户帐户存在。如果其帐户的主机部分允许来自任何(%)主机的连接,这将阻止其他用户连接。} –