1、进入MySQL,创建一个新用户root,密码为root:
格式:grant 权限 on 数据库名.表名 to 用户@登录主机 identified by “用户密码”;
grant select,update,insert,delete on . to root@192.168.1.12 identified by “root”;
原先数据表结构
mysql> use mysql;
Database changed
mysql> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+-----------+------+-------------------------------------------+
执行上述语句后结果
mysql> use mysql;
Database changed
mysql> select host,user,password from user;
+--------------+------+-------------------------------------------+
| host