1.CREATE USER ‘root’@’%’ IDENTIFIED BY ‘root’;
2.GRANT ALL ON . TO ‘root’@’%’;
3. flush privileges;
%:ip on *.*可以设置数据库
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'root';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON *.* TO 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)