标题:mysql 新建用户并授权 & 更新用户密码 出处:刘新修 时间:Thu, 23 Feb 2023 10:35:56 +0000 作者:刘新修 地址:http://pic1.liuxinxiu.com:80/s/309/ 内容: SQL代码 insert into mysql.user(Host,User,Password) values ("%","admin",password("cnmo")); CREATE USER 'admin'@'localhost' IDENTIFIED BY 'cnmo'; GRANT privileges ON *.* TO 'admin'@'localhost'; GRANT ALL privileges on *.* to 'admin'@'localhost' identified by 'cnmo'; FLUSH PRIVILEGES; 更新用户密码 SQL代码 use mysql # 连接权限数据库 update user set password=password('521') where user='root' and host='localhost'; # 改密码 flush privileges; # 刷新权限 Generated by Bo-blog 2.1.1 Release