我昨天也遇上这问题。害我重装了php和mysql
是不是要在mysql的user表里先修改了root的password,然后到phpmyadmin的
config.inc里设置啊?还是用dos命令行:update user set password=PASSWORD('344505') where
user=root
我都不敢试了,免得又要重装。

解决方案 »

  1.   

    我的mysql怎么了?phpmyadmin如下的连接错误 
    错误 
    MySQL 返回: 
    MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO) 好像是帐号设置问题?要怎么解决呢?配置如下,我也没设密码呀 
    $cfgServers[1]['host'] = 'localhost'; // MySQL hostname 
    $cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port 
    $cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket 
    $cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket') 
    $cfgServers[1]['stduser'] = ''; // MySQL standard user settings (this user must have read-only 
    $cfgServers[1]['stdpass'] = ''; // access to the "mysql/user" and "mysql/db" tables) 
    $cfgServers[1]['adv_auth'] = FALSE; // Use advanced authentication? 
    $cfgServers[1]['user'] = 'root'; // MySQL user 
    $cfgServers[1]['password'] = ''; // MySQL password (only needed with basic auth) 
    $cfgServers[1]['only_db'] = ''; // If set to a db-name, only this db is displayed at left frame 
    // It may also be an array of db-names 
    $cfgServers[1]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname 
    $cfgServers[1]['bookdb'] = ''; // Book db - leave blank for no book support 
    $cfgServers[1]['booktable'] = ''; // Book table - leave blank for no book support 估计是mysql的问题 
    我运行phpinfo是可以的,说明php是好的;但运行连到mysql的程序时错误: 
    Warning: Access denied for user: 'root@localhost' (Using password: NO) in C:\apache\htdocs\prog\inc\db_mysql.php on line 98 
    Database error: pconnect(localhost, root, $Password) failed. 
    MySQL Error: () 
    Session halted. 我是在98下用phptriad装的工作环境,请问如果要设mysql管理密码,应该先修改user表还是先修改phpmyadmin中config.inc.php?
      

  2.   

    用phpmyadmin只要配置$cfgPmaAbsoluteUri$cfgServers[1]['user']          
    $cfgServers[1]['password']就行了另外要注意mysql的user里用相应用且host字段为
    $cfgServers[1]['host']的值或 "%"
      

  3.   

    设置mysql密码用
    mysql>SET PASSWORD FOR username@"%" = PASSWORD('password');或者mysql> GRANT USAGE ON *.* TO username@"%" IDENTIFIED BY 'password';加用户用mysql>GRANT ALL PRIVILEGES ON *.* TO user@"%"
              IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
      

  4.   

    我的个人建议是不要手动去改mysql库.
    改密码 最好还是用phpmyadmin.它本身就可以完成呀.
      

  5.   

    如果你没有连接mysql的权力,我看你如何用phpmyadmin去改???