创建用户并授权和改密码:
grant all privileges on *.* to [email protected]‘%‘ identified by ‘123456‘ with grant option;
*9FB2126F7514B6AF42B20E9E4B8E839B72E31
方法一:
#msyqladmin -uroot password nwepassword
#mysqladmin -uroot password oldpassword newpassword
方法二:
create user [email protected]‘localhost‘;
set password for [email protected]‘%‘=password("123456");
set password=password("123456");
方法三:
update mysql.user set password=password("123456") where user=‘root‘ and host=‘%‘;
updata mysql.user set password="*9FB2126F7514B6AF42B20E9E4B8E839B72E31" where user=‘root‘ and host=‘%‘;
刷新权限:
flush privileges;
mysql5.6 授权
密码不能和其他用户重复,否则无法登陆。
时间: 2024-10-18 22:50:14