修改数据库密码的多种方法
目录1.在数据库外修改密码2.数据库内修改密码1.新建用户设置密码2.已有用户修改密码3.在mysql数据库里的user表中,改自己的密码4.修改其他用户的密码5.更新用户密码1.在数据库外修改密码update MySQL.user set authentication_string=password('123') where user='root';2.数据库内修改密码1.新建用户设置密码cre
·
目录
1.在数据库外修改密码
mysqladmin -u root -p旧密码 password 新密码;
2.数据库内修改密码
1.新建用户设置密码
create user root@'localhost' identified by '密码';
2.已有用户修改密码
alter user root@'localhost' identified by '密码';
3. 在mysql数据库里的user表中,改自己的密码
set password = password ('新密码');
4.修改其他用户的密码
set password for '用户名'@'localhost或者%' =password('密码');
5.更新用户密码
update MySQL.user set authentication_string=password('密码') where user='root';
flush privileges‘;
在/etc/my.cnf 中的[mysqld]中添加skip-grant-tables
输入mysql就可以直接进入数据库
更多推荐
已为社区贡献3条内容
所有评论(0)