欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

遇到mysql不可外连的root的解决方法。

程序员文章站 2022-05-16 21:25:15
...

其实就是利用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_CONNECT

其实就是利用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` ;