解決方法:在配置文件my.cnf的[mysqld]下加入skip-name-resolve。 原因是默認(rèn)安裝的MySql開啟了DNS的反向解析。如果禁用的話就不能在MySQL的授權(quán)表中使用主機名了而只能用ip格式。 附:How MySQL uses DNS When a new thread connects to mysqld, mysqld will spawn a new thread to handle the request. This ...
skip-name-resolve skip-grant-tables 官方的解釋 How MySQL uses DNS When a new thread connects to mysqld, mysqld will spawn a new thread to handle the request. This thread will first check if the hostname is in the hostname cache. If not the thread will call ...