登录数据库
mysql -u root –p

image

使用mysql数据库
use mysql

修改root访问权限
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’IDENTIFIED BY ‘密码’ WITH GRANT OPTION;

刷新生效
flush privileges

 

image