mysql 忘记密码
Mariadb 5.5 需要更新 password 字段。
sudo mysqld_safe --skip-grant-tables &
MariaDB [mysql]> UPDATE user SET password=PASSWORD(''),authentication_string='' WHERE user='root';
Query OK, 5 rows affected (0.00 sec)
Rows matched: 5 Changed: 5 Warnings: 0
MariaDB [mysql]> select user, host, password,authentication_string from user;
+--------+--------------+----------+-----------------------+
| user | host | password | authentication_string |
+--------+--------------+----------+-----------------------+
| root | localhost | | |
| root | 10-0-160-127 | | |
| root | % | | |
| root | ::1 | | |
| root | 127.0.0.1 | | |
| zstack | localhost | | |
| zstack | % | | |
+--------+--------------+----------+-----------------------+