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

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

问题描述

我更改了 root 密码来测试,现在我无法在 XAMPP 的 phpMyAdmin 页面中登录.我寻求帮助 此处此处这基本上说在 XAMPPPHPMYADMIN 文件夹中更改了 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 XAMPPPHPMYADMIN 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.

推荐答案

以上代码修复了大部分人的问题,但我仍然无法登录.终于找到了(上面代码中的第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天全站免登陆