新装的mysql5.7密码比较复杂变态,需要修改后才能继续操作。
mysql> use mysql;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> update user set password=passworD("test") where user='root';
ERROR 1046 (3D000): No database selected
mysql>
mysql> set password=password("yourpasswd");
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>
mysql>
mysql>
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)