在虚拟机上测试数据库备份功能,需要连接外部机器上的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. 必须关注的25位知名JavaScript开发者

    必须关注的25位知名JavaScript开发者 发表于2012-08-07 17:30| 16215次阅读| 来源Crossrider Blog| 46 条评论| 作者Crossrider Blog ...

  2. c# 中的委托以及匿名方法lambda

    1.委托的定义internal delegate int MyAddFunDe(int a,int b)2.匿名方法1)MyAddFunDe fun = delegate(int a,int b){  ...

  3. PHP函数——urlencode() 函数

    urlencode($str)的作用是对字符串$str进行url编码,方便$str作为一个变量传递给下一页,一般情况下$str有两种, 第一种是数组类型,如果想将数组作为url的一个参数,即必须将数组 ...

  4. 230. Kth Smallest Element in a BST ——迭代本质:a=xx1 while some_condition: a=xx2

    Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Not ...

  5. struts2 拦截器 interceptor

    struts2 拦截器详解:http://struts2.group.iteye.com/group/wiki/1397-deep-into-struts2-interceptors

  6. MySql避免全表扫描【转】

    原文地址:http://blog.163.com/ksm19870304@126/blog/static/37455233201251901943705/ 对查询进行优化,应尽量避免全表扫描,首先应考 ...

  7. eclipse常用的字体

    1.consolas 2.Segoe Script 3.Segoe Print 4.Courier New

  8. lazyload 分页加载

    http://www.neoease.com/lazy-load-jquery-plugin-delay-load-image/ echo $d['pic']; ?>" src=&qu ...

  9. cordova 5.0 白名单

    最新的cordova 5.0 更新了白名单机制,增强了安全性,但是也给我们在开发中带来了很多问题: 当你引入谷歌.百度地图时,会出现 Failed to load resource -- 解决办法: ...

  10. Hibernate中的多对多映射

    1.需求 项目与开发员工 一个项目,有多个开发人员 一个开发人员,参与多个项目 [多对多] 2.实体bean设计 Project: public class Project { private int ...