欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql数据库用户密码管理

程序员文章站 2022-05-17 16:53:06
创建用户:create user 'oracle'@'localhost' identified by 'password'; MySQL 8以上:alter user 'root'@'localhost' identified with mysql_native_password by 'newp ......

创建用户:create user 'oracle'@'localhost' identified by 'password';

mysql 8以上:alter user 'root'@'localhost' identified with mysql_native_password by 'newpassword';

mysql 8以下版本: 1.set password for 'root'@'localhost' password('newpassword');

           2.update user set password="newpassword" where user="root";

                               3.mysqladmin -uroot -ppassword password newpassword;