1. 程式人生 > >Mysql初始化操作

Mysql初始化操作

忘記密碼,修改my.cnf

[mysqld]

 skip-grant-tables=1

 

重設密碼

use mysql

UPDATE user SET Password = password ( '123456' ) WHERE User = 'root' ; 

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

flush privileges;