s*s 后端出现1042, u”Can’t get hostname for your address”的解决办法

  • 7
  • 6,484 views
  • A+
所属分类:工具资源

近日配置一台vps后端的时候出现1042, u"Can't get hostname for your address"这样的错误提示,后来搜索发现是远端数据库设置的原因。修改了数据库的配置文件后解决了,但是还是有个疑问,为什么其它vps不出现这样的情况呢?

修改vi /etc/my.cnf,在[mysqld]下添加

skip-name-resolve
#忽略主机名的方式访问
lower_case_table_names=1
#忽略数据库表名大小写

然后service mysql restart重启一下数据库就好了。

weinxin
我的微信公众号
我的微信公众号扫一扫

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:7   其中:访客  0   博主  0

    • 云梦男孩 云梦男孩 3

      Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

      云梦男孩
      厘米,在这儿留言能不能让百度抓到我的站。

      • mrxn mrxn 1

        Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

        貌似不错

          • 云梦男孩 云梦男孩 3

            Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

            @mrxn 比你快1秒,我是沙发 :mrgreen:

              • mrxn mrxn 1

                Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                @云梦男孩 我那个擦。。。来波友链?我是从同盟源那里过来的 哈哈

                  • 云梦男孩 云梦男孩 3

                    Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                    @mrxn 我刚搭的站,目前才两篇文章。

                    • E4rljia E4rljia 3

                      Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                      @mrxn 兄弟弄得不错啊!还挺好看。

                    • E4rljia E4rljia 3

                      Warning: Use of undefined constant auto - assumed 'auto' (this will throw an Error in a future version of PHP) in /www/wwwroot/past.cmsky.org/wp-content/themes/begin5.2/inc/inc.php on line 911

                      @云梦男孩 兄弟你的站可真够慢的啊、