MYSQL中5.7.10ROOT密碼及創建用戶


 

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
成功!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM