登录虚拟机后,使用passwd密令更改用户密码,新密码需要输入两次才能更改成功.不多说,直接上代码 [root@localhost Desktop]# passwd //使用passwd密令 Changing password for user root. New password: //第一次输入新密码 BAD PASSWORD: it is too short BAD PASSWORD: is too simple Retype new password: //第二次输入新密码 passwd
1.更改root密码 use mysql; update user set password=password('petecc') where user='root'; 2.root远程登录 1 update user set host='%' where host='localhost'; 2 flush privileges;
更改用户名密码,官方推荐使用alter ALTER USER test@'%' IDENTIFIED BY '; 还有一种 update mysql.user set authentication_string=password("新密码") where User="test" and Host="localhost"; 用update语句需要flush privileges; 参考 MySQL 5.7推荐使用ALTER USER修改密码 htt