其实就是利用root的权限建立一个%的用户。具体方法:
create user ‘whoami’@’%’ identified by ‘whoamifortest’;
grant all privileges on *.* to ‘whoami’@’%’ identified by ‘whoamifortest’with grant option
max_queries_per_hour 0 max_connections_per_hour 0
max_updates_per_hour 0 max_user_connections 0;
最后记得拖完库把建的用户删掉
drop user ‘whoami’@’%’;
drop database if exists `whoami` ;
原文地址:遇到mysql不可外连的root的解决方法。, 感谢原作者分享。