进入数据库
mysql -u root -p
修改密码
set password = password(”)
创建用户和密码
CREATE USER ”@’%’ IDENTIFIED BY ‘123456’;
设置权限
grant all privileges on test.* to root@’192.168.2.71’ identified by ‘lichenyi’; //lichenyi 用户密码
grant all privileges on test.* to root@’%’ identified by ‘密码’;//给所有的权限给所有的ip
刷新权限
flush privileges;