Grant all privileges on *. * TO root @ "%" identified by 'abc'; mysql> select user, host, password from mysql. user; + ------ + ----------- + ------------------ + | user | host | password | + ------ + ----------- + ------------------ + | root | localhost | root | wengdev01 | root | 127.0.0.1 | | localhost | wengdev01 | root | % | 7b49a39922703c30 | + ------ + ----------- + ------- ----------- + 6 rows in set (0.00 sec) delete from mysql. user WHERE Host <> '%' and user = 'root'; mysql> select user, host, password from mysql. user; + ------ + ---------------- + | user | host | password | + ------ + ------------------ + | root | % | 7b49a39922703c30 | + ------ + ------------------ + 1 row in set (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) # Or delete from mysql. user where password = ''or user =''; update mysql. user set host = '%' where user = 'root'; grant all privileges on *. * TO root @ "%" identified by 'abc'; flush privileges; create a user and grant all permissions except administration. Grant create, DROP, grant option, REFERENCES, EVENT, ALTER, DELETE, INDEX, INSERT, SELECT, UPDATE, lock tables, TRIGGER, create temporary tables, create view, show view on *. * TO cs @ "%" identified by 'abc ';
Author jqjyy