t@ytt-centos6-3 ~]$ mysql_config_editor set --login-path=itsmine --host=localhost --user=ytt --password
Enter password:
[ytt@ytt-centos6-3 ~]$ mysql --login-path=itsmine -S /tmp/mysql3307.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
...
mysql> select user();
+---------------+
| user() |
+---------------+
| ytt@localhost |
+---------------+
1 row in set (0.00 sec)
mysql> exit
Bye
[ytt@ytt-centos6-3 ~]$ file .mylogin.cnf
.mylogin.cnf: data
mysql> show plugins;
+----------------------------+----------+--------------------+----------------------+-------------+
| Name | Status | Type | Library | License |
+----------------------------+----------+--------------------+----------------------+-------------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
...
| validate_password | ACTIVE | VALIDATE PASSWORD | validate_password.so | PROPRIETARY |
+----------------------------+----------+--------------------+----------------------+-------------+
45 rows in set (0.00 sec)
mysql>
mysql> set password for ytt_new@'localhost'= password('2lOp23dll&D');
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
好文拜读. ourmysql.com 好样的.
国内谷歌总被墙,烦。发现个在线google代理,真不错。http://www.boyunjian.com/do/googlepx/index.html?fm=9001