mysql root 密碼的設置方法shell> mysql -u root mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');If you know what you are doing, you can also directly manipulate the privilege tables: shell> mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password')
    ->     WHERE user='root';
mysql> FLUSH PRIVILEGES;Another way to set the password is by using the mysqladmin command: shell> mysqladmin -u root password new_password註明: windows 用戶第一次運行 winmyadmin 會要求輸入並設置 root password
PHP Myadmin 請修改 config.inc.php默認是 user = root; pwd =空
簡單方式修改
$cfgServers[1]['auth_type']     = 'config'; 
變成
$cfgServers[1]['auth_type']     = 'http'; 
這樣在運行 myadmin 時會要求你輸入 user/pwd 登入如果想自動進入
$cfgServers[1]['user']          = 'root';
$cfgServers[1]['password']      = '';改這裡的用戶和密碼

解决方案 »

  1.   

    一种是:[root@MyHost mysql]#.bin/mysqladmin -u root -password[newpassword]
    另一种是:
    mysql>SET PASSOWRD FOR root=PASSWORD('newpassword');newpassword是指新的root的用户密码php myadmin同上
      

  2.   

    建立一个超级用户.下面是需要输入的代码。
    mysql>GRANT ALL PRIVILEGES ON *.* TO RobinCat@localhost IDENTIFIED BY '1234' WITH GRANT OPTION;
    // RobinCat是用户名
    // 1234是密码~phpmyadmin只须修改config.php3.ini如下:
    $cfgServers[1]['host'] = '数据库服务器IP';           
    $cfgServers[1]['port'] = '';                    
    $cfgServers[1]['adv_auth'] = false;             
    $cfgServers[1]['stduser'] = 'root';             
    $cfgServers[1]['stdpass'] = '';                 
    $cfgServers[1]['user'] = '数据库用户名';                
    $cfgServers[1]['password'] = '密码';               
    $cfgServers[1]['only_db'] = '数据库名称';                 
    $cfgServers[1]['verbose'] = ''; ——明了吧??嘿嘿~