进入 mysql 安装目录
1cd /usr/local/mysql
2cd bin
3./mysqld_safe --skip-grant-table & mysql
4use mysql
5update user set password=password("new password") where user="root"
进入 mysql 安装目录
1cd /usr/local/mysql
2cd bin
3./mysqld_safe --skip-grant-table & mysql
4use mysql
5update user set password=password("new password") where user="root"