mysql全局权限账户%登录不上
mysql全局权限账户%登录不上ERROR 1045 (28000): Access denied for user ‘zq’@‘localhost’ (using password: YES)
帐号密码都对了 就是连不上。细心的话我们会发现 帐号权限是%,而这里提示的是localhost。
解决方式:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
同一个账户 要同时存在%帐号或者localhost帐号时, %帐号才起作用。