原因其实很简单,mysql中一个用户名为空的访问本地权限的字段,所有登陆时优先匹配了这一条,就无法登陆了。 #解决办法:删除用户即可 drop user ''@localhost; #刷新 flush privileges;