phpmyadmin XAMPP MySQL表示:无法联机:无效设置

mfuanj7w  于 2022-11-09  发布在  PHP
关注(0)|答案(7)|浏览(179)

MySQL工作正常,然后没有任何原因,我开始得到这个错误,每当我打开http://localhost/phpmyadmin/

我花了几个小时在这里试图找到解决办法,但我所尝试的一切都不起作用。
有人能帮帮我吗?
我正在使用:XAMPP版本:7.3.6
谢谢
config.inc.php文件内容

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';

/*
 * End of servers configuration
 */

?>
koaltpgm

koaltpgm1#

解决方案-久经考验。
打开文件夹〉〉C:\xampp\mysql\bin打开文件(编辑)〉〉my.ini
添加此行


# The MySQL server

default-character-set=utf8mb4
[mysqld]
skip-grant-tables   <<<--- Add this line
port=3306

保存文件。
重新启动XAMPP。请转到http://localhost/phpmyadmin/
这就是了。

j5fpnvbx

j5fpnvbx2#

运行此命令

mysqladmin -u root password 'mynewpassword'
n9vozmp4

n9vozmp43#

$cfg['Servers'][$i]['AllowNoPassword'] = true;   <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false;  <--- to this fixed the problem.

注意:localhost中还有其他地方需要你手动修改密码。例如在“CD收藏”中,密码是硬编码的,而不是从config.inc.php中获取的。

yacmzcpb

yacmzcpb4#

我不知道为什么,但由于某些原因,当我以管理员身份启动XAMPP控制面板时,我可以连接到phpMyAdmin,没有任何问题

5hcedyr0

5hcedyr05#

错误信息有点混乱,因为它提到了MariaDb服务器。最近对WAMP服务器进行了更改,以允许MariaDb,不知道XAMPP是否也做了同样的更改。WAMP server switch MySQL to MariaDB
如果你以管理员的身份运行它,我会说它在正常运行时不能访问设置文件。你能检查一下config.inc.php的权限吗?
当它以管理员身份连接时:是否必须输入mySql用户名和密码?在数据库面板中看到什么?服务器:本地数据库(127.0.0.1通过TCP/IP)服务器类型:MySQL服务器版本:5.7.14 - MySQL社区服务器(GPL)协议版本:10用户:root@localhost服务器字符集:UTF-8 Unicode(utf8),示例:

nfs0ujit

nfs0ujit6#

可能是安全预防措施。您可以尝试添加一个新的管理员帐户:

mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     WITH GRANT OPTION;

https://stackoverflow.com/a/1559992/7528823

xxb16uws

xxb16uws7#

我刚刚遇到同样的问题几分钟前,我确信我不需要任何配置更改,所以我所做的是清除cookie和网站数据从127.0.0.1(可能是localhost代替,在您的情况下),它被解决了!

相关问题