1. 连接数据库
2. 授权并刷新权限
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
3. 查看用户数据
use mysql
select user, password, host from user;
4.修改配置文件,注释bind-address
配置文件地址:/etc/mysql/mariadb.conf.d/50-server.cnf
5.重启数据库
sudo systemctl restart mysql