如何修复 phpmyadmin 的“拒绝访问”消息?

问题描述 投票:0回答:2

每次关机后启动笔记本电脑时,我都需要重新安装 XAMPP 来解决“访问被拒绝”的问题以及其他几个错误(如上传的照片所示)。从 XAMPP 重新启动服务器不会改变任何内容。其背后的真正原因是什么以及如何解决?

php mysql phpmyadmin xampp
2个回答
0
投票

进入文件夹C:\xampp\phpMyAdmin,该文件夹中有一个文件“config.inc.php”。在 Notepad++ 或 Sublime Text 或任何文本编辑器中打开此文件。

在此代码下方添加这 2 个代码:

$cfg['Servers'][$i]['auth_type'] = 'cookie';

添加以下代码:

$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;

重新启动你的xampp,它就会工作了

我的 xampp 配置代码如下:

<?php

/* Servers configuration */
$i = 0;

$cfg['blowfish_secret'] = 'a8b7c6d'; //What you want

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'Local Databases';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

// Hidden databases in PhpMyAdmin left panel
//$cfg['Servers'][$i]['hide_db'] = '(information_schema|mysql|performance_schema|sys)';

// Allow connection without password
$cfg['Servers'][$i]['AllowNoPassword'] = true;

// Suppress Warning about pmadb tables
$cfg['PmaNoRelation_DisableWarning'] = true;

// To have PRIMARY & INDEX in table structure export
//$cfg['Export']['sql_drop_table'] = true;
//$cfg['Export']['sql_if_not_exists'] = true;

$cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/refman/5.7/en/';
/* End of servers configuration */

?>

0
投票

进入文件夹

C:\xampp\phpMyAdmin
,该文件夹中有一个名为
config.inc.php
的文件。在 Notepad++ 或 Sublime Text 或任何文本编辑器中打开此文件。 如果您添加任何密码,请在其中键入密码。例如。我的密码是
mysql123
,配置行必须是:

$cfg['Servers'][$i]['password'] = 'mysql123';
© www.soinside.com 2019 - 2024. All rights reserved.