1. 程式人生 > >Linux 下mysql 忘記root密碼,修改密碼怎麼做?在mysql.user 中並沒有password欄位,但是有authentication_string

Linux 下mysql 忘記root密碼,修改密碼怎麼做?在mysql.user 中並沒有password欄位,但是有authentication_string

第一步:  vi /etc/my.cnf  在[mysqld] 下 增加 --skip-grant-tables

第二步: service mysql restart

第三步: shell>mysql  進入 控制檯

4:     use mysql

5:   update user set authentication_string = password("123456") where user='root';