mysql说:无法连接:无效的设置. Xampp [英] mysql said: Cannot connect: invalid settings. xampp

查看:323
本文介绍了mysql说:无法连接:无效的设置. Xampp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将root密码更改为test,现在无法在XAMPP的phpMyAdmin页面中登录.我寻求帮助此处基本上表示更改了 XAMPP \ PHPMYADMIN 文件夹中的 config.inc.php 文件.

I changed the root password to test and now I cannot login in phpMyAdmin page in XAMPP. I looked for help here and here which basically says changed config.inc.php file in XAMPP\PHPMYADMIN folder.

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$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'] = 'test';    <---- changed this
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'test'; <--- I changed this too (Edit: Not needed)

下面的代码使用上面的密码,工作正常

This code below works which uses the above password

if($_SERVER['REMOTE_ADDR']=="127.0.0.1")
{
define("DATABASE_SERVER", "localhost");
define("DATABASE_USERNAME", "root");
define("DATABASE_PASSWORD", "test");
define("DATABASE_NAME", "TIGERWOODS");
} 

这在Mac上发生在我之前,但我无法解决.现在,它在WinXP上又发生了.我正在使用Xampp 1.7.4.

This happend to me bofore on Mac and I could not resolve it. Now it happened again on WinXP. I am using Xampp 1.7.4.

推荐答案

上面的代码解决了大多数ppl的问题,但我仍然无法登录.最终我发现了这一点(上面代码中的第9行需要更改)

The above code fixed problem for most of the ppl but I still could not login. Finally I found this (line#9 in the above code needs to be changed)

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

注意:localhost中的其他区域必须手动更改密码.例如在"CD Collection"示例中.密码是在此处进行硬编码的,而不是从config.inc.php中获取.

Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.

这篇关于mysql说:无法连接:无效的设置. Xampp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆