查看: 1286|回复: 7
|
phpmyadmin不能login
[复制链接]
|
|
我installed了 mysql 4.1 , phpmyadmin 2.8.1 以及 mysql administrator
我可以用 username : root / password : 123456 来login mysql administrator
但是当我要login phpmyadmin时出现
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
为何我不能loginn呢? 同时为何using passord: NO ? |
|
|
|
|
|
|
|
发表于 28-8-2006 07:33 PM
|
显示全部楼层
原帖由 一只优雅的猪 于 28-8-2006 03:27 PM 发表
我installed了 mysql 4.1 , phpmyadmin 2.8.1 以及 mysql administrator
我可以用 username : root / password : 123456 来login mysql administrator
但是当我要login phpmyadmin时出现
#1045 - Acce ...
你设了phpmyadmin\config.inc.php了吗?
例子:
- <?php
- /*
- * Generated configuration file
- * Generated by: phpMyAdmin 2.8.2 setup script by Michal Čihař <michal@cihar.com>
- * Version: $Id: setup.php,v 1.23.2.10 2006/05/15 07:57:30 nijel Exp $
- * Date: Tue, 04 Jul 2006 20:12:06 GMT
- */
- /* Servers configuration */
- $i = 0;
- /* Server localhost (config:root) [1] */
- $i++;
- $cfg['Servers'][$i]['host'] = 'localhost';
- $cfg['Servers'][$i]['extension'] = 'mysqli';
- $cfg['Servers'][$i]['connect_type'] = 'tcp';
- $cfg['Servers'][$i]['compress'] = false;
- $cfg['Servers'][$i]['controluser'] = 'root';
- $cfg['Servers'][$i]['controlpass'] = '1';
- $cfg['Servers'][$i]['auth_type'] = 'config';
- $cfg['Servers'][$i]['user'] = 'root';
- $cfg['Servers'][$i]['password'] = 'thisismypassword';
- /* End of servers configuration */
- $cfg['AllowAnywhereRecoding'] = false;
- $cfg['DefaultCharset'] = 'utf-8';
- $cfg['RecodingEngine'] = 'iconv';
- $cfg['IconvExtraParams'] = '//TRANSLIT';
- ?>
复制代码 |
|
|
|
|
|
|
|
楼主 |
发表于 28-8-2006 09:01 PM
|
显示全部楼层
why i can't found tat "config.inc.php" in phpmyadmin folder?
i'm using phpmyadmin 2.8.1 |
|
|
|
|
|
|
|
发表于 28-8-2006 09:26 PM
|
显示全部楼层
原帖由 一只优雅的猪 于 28-8-2006 09:01 PM 发表
why i can't found tat "config.inc.php" in phpmyadmin folder?
i'm using phpmyadmin 2.8.1
难道你没看到这行字吗?
Probably reason of this is that you did not create configuration file. You might want to use setup script to create one.
按了过后,它会带你去一个设定config.inc.php的界面。
在设定完毕后那网页会自动帮你generate出来的config.inc.php的code。
所以,你就把那些code存在config.inc.php(当然要手动创立新文件->config.inc.php)就可以了。
你不会设的话,可以参考我所设的例子,也可以去其网站寻找有关设定资料。
不需经过localhost界面,只需直接在phpmyadmin\的directory create个config.inc.php,把那些code存在里面就行了。 |
|
|
|
|
|
|
|
楼主 |
发表于 29-8-2006 08:21 AM
|
显示全部楼层
在config.inc.php,我换了一些setting
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
然后在mysql command line client里execute了以下的command
SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('123456');
----------------------------------------------------------------------
现在出现
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
#1045 - Access denied for user 'root'@'localhost' (using password: YES) |
|
|
|
|
|
|
|
发表于 29-8-2006 03:29 PM
|
显示全部楼层
原帖由 一只优雅的猪 于 29-8-2006 08:21 AM 发表
在config.inc.php,我换了一些setting
$cfg = 'root';
$cfg = '123456';
然后在mysql command line client里execute了以下的command
SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('123456');
...
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 这个你用回mysql 的password不行吗? |
|
|
|
|
|
|
|
楼主 |
发表于 30-8-2006 02:02 AM
|
显示全部楼层
试过了,我放回 $cfg['Servers'][$i]['password'] = 'thisismypassword';
还是不行。。。
我login mysql administrator 是用
username : root / password : 123456 |
|
|
|
|
|
|
|
发表于 30-8-2006 12:51 PM
|
显示全部楼层
原帖由 一只优雅的猪 于 30-8-2006 02:02 AM 发表
试过了,我放回 $cfg = 'thisismypassword';
还是不行。。。
我login mysql administrator 是用
username : root / password : 123456
你会出现这样的error,按理说是
不是
$cfg['Servers'][$i]['controluser']
$cfg['Servers'][$i]['controlpass']
,就是
$cfg['Servers'][$i]['user']
$cfg['Servers'][$i]['pass']
有error了。
既然你讲
login mysql administrator 是用
username : root / password : 123456,
那就证明你肯定你的password是正确。
所以我猜测你应该是之前把我贴的 “$cfg['Servers'][$i]['controlpass'] = 1”也一起copy& paste下去,忘了改吧~所以才。。
controlpass的默认设定必须是跟mysql的root password一样的(当然也可以另外更改)
总之,若你是单一用户的话,只要使用以下的基本设置就可以了:
<?php
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123456';
?>
欲知详细设定,或要设多用户与不同权限的功能的话,可以参考:http://www.devside.net/web/server/windows/phpmyadmin
[ 本帖最后由 亡者之疯 于 30-8-2006 12:58 PM 编辑 ] |
|
|
|
|
|
|
| |
本周最热论坛帖子
|