#shell> mysqladmin -uroot -p password 123456 //把密码改成123456
enter password : enter 即可
然后添加 admin 远程访问帐户:
登陆到MySQL Server上去:
#shell>mysql -uroot -p123456 //用root登陆,密码123456 , 也 可以交互: mysql -uroot -p ,系统提示输入密码:123456
mysql> use mysql;
mysql> GRANT ALL ON *.* TO admin@'localhost' IDENTIFIED BY 'admin' WITH GRANT OPTION; //可以从任何IP访问
mysql> GRANT ALL ON *.* TO admin@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION; //可以从localhost访问
/**
* The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
* at least one server configuration uses 'cookie' auth_type, enter here a
* passphrase that will be used by blowfish. The maximum length seems to be 46
* characters.
*/
$cfg['blowfish_secret'] = '1234567890'; //随便填写,最长46个字符
。。。
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
//以下两项仅仅当 auth_type = config 时候 ,才有效, 这样,就不会有登陆窗口 , 直接就进入,可以直接操作MySQL 了。
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = '123456'; // MySQL password (only needed
// with 'config' auth_type)