mysql> show grants;
+-------------------------------------------------------------------------------+
| Grants for root@localhost |
+-------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE ON *.* TO 'root'@'localhost' |
| GRANT ALL PRIVILEGES ON `TESTSTRAP`.* TO 'root'@'localhost' WITH GRANT OPTION |
+-------------------------------------------------------------------------------+
mysql> GRANT DELETE ON *.* TO 'root'@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
mysql> select password from mysql.user where user='root';
+----------+
| password |
+----------+
| |
+----------+
1 row in set (0.00 sec)
root 用户没有密码,但是在 GRANT 的时候提示 using password: NO