#查看MySQL 默认密码
sudo vim /etc/mysql/debian.cnf
#进入数据库
mysql -udebian-sys-maint -p
#修改root用户密码
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY "rootpass";
flush privileges;
#新增用户
create user 'newuser'@'%' identified with mysql_native_password BY "newuser";
flush privileges;
#给新用户授权
grant all privileges on *.* to 'newuser'@'%' with grant option;
ubuntu20.04 上 mysql8.0 用户密码修改
于 2022-07-13 14:29:47 首次发布