If mysql is running, first kill: killall -term mysqld.
Start mysql: bin / safe_mysqld --skip-grant-Tables &
You can enter mysql without a password.
Then it is> Use mysql> update user set password = password ("new_pass") where user = "root";> flush privilege; re-mysql, start MySQL with normal method.