--下面我们尝试用password函数方式来更新password列
root@localhost[mysql]> update user set password=password('passwd') where user='linuxidc'; --此方式更新成功
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0
root@localhost[mysql]> select host,user,password from user where user='linuxidc'; --可以看到密码已经变成了密文
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | linuxidc | *59C70DA2F3E3A5BDF46B68F5C8B8F25762BCCEF0 |
+-----------+------+-------------------------------------------+
root@localhost[mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
--此时登陆成功
robin@SZDB:~> mysql -ulinuxidc -ppasswd
linuxidc@localhost[(none)]>
--------------------------------------分割线 --------------------------------------
Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL
Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群
Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb
--------------------------------------分割线 --------------------------------------