在虚拟机上测试数据库备份功能,需要连接外部机器上的mysql,pdo总是报超时错误!

起初认为是用的mysql账号的域不匹配!后来发现不是因为这个!

在终端中用mysql命令尝试连接,发现返回的错误是:

ERROR 1042 (HY000): Can’t get hostname for your address

网上搜了搜,真的找到了解决方法:

//解决办法:添加配置文件
[mysqld]
skip-name-resolve

不过这么设置后,以后连接这台机器上的mysql只能通过ip地址的形式。

mysql的ERROR:1042的更多相关文章

  1. 连接Mysql错误 error 1042 can't get hostname for your address

    背景: 1.etc下的hosts文件有:     127.0.0.1   localhost 2.MySQL的my.ini配置文件:     [mysqld] 节点下已经加入以下两行代码 skip-n ...

  2. mysql: Error Codes and Messages

    Appendix B. Error Codes and MessagesTable of Contents B.1. Server Error Codes and MessagesB.2. Clien ...

  3. Discuz! X3搬家后UCenter出现UCenter info: MySQL Query Error解决方案

    Discuz! X3 X2.5论坛搬家后 登录UCenter出现报错:UCenter info: MySQL Query ErrorSQL:SELECT value FROM [Table]vars ...

  4. Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table

    Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table ...

  5. MySQL Replication Error 处理一例

    故障现象 MySQL slave status详情 mysql> show slave status\G *************************** 1. row ********* ...

  6. mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file

    mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...

  7. xampp启动MySQL出现Error: MySQL shutdown unexpectedly.

    20175227张雪莹 2018-2019-2 <Java程序设计> xampp启动MySQL出现Error: MySQL shutdown unexpectedly. 问题 本周在学习教 ...

  8. MySQL :: Fatal error: Can&#039;t change to run as user &#039;mysql&#039;. Please check that the user exists!

    Fatal error: Can't change to run as user 'mysql'. Please check that the user exists! MySQL :: Fatal ...

  9. MySQL错误ERROR 2002 (HY000): Can't connect to local MySQL server

    From: http://www.jb51.net/article/56952.htm 这篇文章主要介绍了MySQL错误ERROR 2002 (HY000): Can't connect to loc ...

随机推荐

  1. python中函数使用

    1.关于函数的调用,简单小例子: >>> def fun():  print(test) >>> test='ni hao ma ?'>>> fu ...

  2. 转载css层级优先级。

    解读CSS样式优先级(修改门户自定义样式必读) 一.什么是CSS优先级?所谓CSS优先级,即是指CSS样式在浏览器中被解析的先后顺序.当同一个元素(或内容)被多个CSS选择符选中时,就要按照优先权取舍 ...

  3. SVN删除同名文件夹

    解     释一下:     SVN  出现这个错误的原因是我删除了一个文件夹后又创建了一个同名文件夹.  在  svn   server  端,好像是不能区分这两个文件夹,所以出现了错误.     ...

  4. 【北京站】详解Visual Studio 2013:开发iOS及android应用!现场图集

    现场图集: 活动介绍地址:http://huiyi.csdn.net/module/meeting/meeting/info/660/biz

  5. NGINX Plus 现在完全支持 HTTP/2

    早些时候,我们发布了支持 HTTP/2 协议的 NGINX Plus R7.作为 HTTP 协议的最新标准,HTTP/2 的设计为现在的 web 应用程序带来了更高的性能和安全性.(LCTT 译注: ...

  6. C#.NET SQL数据库备份与还原解决方案

    C#.NET SQL数据库备份与还原解决方案http://www.csframework.com/archive/1/arc-1-20110924-1841.htm 开发框架V2.2(快速开发版)系统 ...

  7. POJ 2240 && ZOJ 1082 Arbitrage 最短路,c++ stl pass g++ tle 难度:0

    http://poj.org/problem?id=2240 用log化乘法为加法找正圈 c++ 110ms,g++tle #include <string> #include <m ...

  8. ubuntu下 GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题

    网上的解释是:“ you need to add -lstdc++, or use 'g++' rather than 'gcc' as your driver program.”,也就是说如果想要使 ...

  9. 微信支付调用JSAPI缺少参数:timeStamp

    一般是安卓没问题,苹果会出现这样的问题,弹出下面这样的提示,如果你也是这样,那就恭喜你,现在,你找到解决的方法了 请看红色框框的timeStamp(图片有点小,可以鼠标右键打开图片 查看) 请注意,这 ...

  10. Unity安卓连接profile调试

    通过USB ADB 1.从Unity中Export Android 工程的时候一定要勾选 Development Build,autoconnect profiler 2.cmd进入adb的目录(打开 ...