mysql 配置 文件 设置 优化 调优 解决 问题 方法 my.cnf my.ini 注释Host is not allowed to connect to this

MySQL配置文件在Windows下叫my.ini,在MySQL的安装根目录下;

在Linux下叫my.cnf,该文件位于/etc/my.cnf。

Host '127.0.0.1' is not allowed to connect to this MySQL server

一般原因: MySQL数据库的配置文件my.ini中设置了参数: skip-name-resolve
      从而导致使用“localhost”不能连接到数据库。

解决方法: 注释掉: #skip-name-resolve

注释掉对数据库的设置略有影响,有时候会导致连接数据库慢。

原文地址:https://www.cnblogs.com/shaoing/p/6094714.html