#查看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 "newpass";
flush privileges;
#给新用户授权
grant all privileges on *.* to 'newuser'@'%' with grant option;
树莓派ubuntu修改mysql8.0用户密码
于 2022-07-13 14:29:47 首次发布