mysql 5.7.10重置root密碼: 1.my.nin文件里在 [mysqld]下增加skip-grant-tables 2.cmd:net start mysql -mysql -use mysql; -UPDATE user SET authentication_string=PASSWORD(NEWPASSWORD) WHERE User=root; -FLUSH PRIVILEGES; -quit; 3.登陸
| mysql 5.7.10重置root密碼: 1.my.nin文件里在 [mysqld]下增加“skip-grant-tables” 2.cmd:net start mysql ->mysql ->use mysql; ->UPDATE user SET authentication_string=PASSWORD("NEWPASSWORD") WHERE User='root'; ->FLUSH PRIVILEGES; ->quit; 3.登陸時,將my.min文件里的“skip-grant-tables”刪除 登陸mysql -u用戶 -p密碼; 如果登陸進去報錯1820, 登陸mysql -u -p 進去:輸入mysql> SET PASSWORD = PASSWORD('123456'); 創建用戶: create user hzx; update user set authentication_string=password("123456") where user="hzx"; grant all on hzx.* to 'hzx'@'localhost'; create user text; update user set authentication_string=password("123456") where user="text"; grant all on text.* to 'text'@'localhost'; 3.刷新數據庫 (一定要記得刷新) mysql>flush privileges; quit mysql -uhzx -p 123456 成功! |