MySQL报错解决方案:2013-Lost connection server at ‘waiti

今天上课的时候,在搭建完MySQL测试环境中出现的问题,整理如下:

问题描述:搭建完MySQL,用远程连接工具(Navicat)连接时报错:

2013-Lost connection to MySQL server at ‘waiting for intial communication packet‘,system error:0

原因分析:
MySQL开启了DNS的反向解析功能,这样MySQL对连接的客户端会进行DNS主机名查找;

解决方式:

找到mysql安装配置文件:my.cnf;路径因环境而异。如果你的是Liunx的环境,可以去目录:/etc/my.cnf中查找

编辑文件:my.cnf,找到【mysqld】模块

在其下增加一行:skip-name-resolve 如下图所示:

保存退出,并重启mysql服务:service mysql restart 即可,再重新连接看看!



欢迎加入我们进行讨论、学习

微信\电话:15630991706

QQ:1274057839

北京线下就业班

全国网络直播班

北京线下提高班

同步开课,转岗、跳槽的可以报名、咨询

原文地址:http://blog.51cto.com/dotest/2328195

时间: 2024-08-29 19:07:14

MySQL报错解决方案:2013-Lost connection server at ‘waiti的相关文章

MySQL报错解决方案:2013-Lost connection to MySQL server

今天上课的时候,在搭建完MySQL测试环境中出现的问题,整理如下: 问题描述:搭建完MySQL,用远程连接工具(Navicat)连接时报错: 2013-Lost connection to MySQL server at 'waiting for intial communication packet',system error:0 原因分析:MySQL开启了DNS的反向解析功能,这样MySQL对连接的客户端会进行DNS主机名查找: 解决方式: 找到mysql安装配置文件:my.cnf:路径因环

安装opesntack mysql报错 解决方案

安装opesntack mysql报错 ERROR : Error appeared during Puppet run: 192.168.1.103_mysql.ppError: mysqladmin -u root  password 'f40e1dec1deb43d3' returned 1 instead of one of [0] # rpm -qa | grep -i mysqlmysql-server-5.1.71-1.el6.x86_64perl-DBD-MySQL-4.013-

连接mysql报错java.sql.SQLException: The server time zone value '?й???????' is unrecognized...解决方法

报错内容: java.sql.SQLException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time

修改mysql端口后重启mysql报错:Can't start server: Bind on TCP/IP port. Got error...n denied

1:错误信息:如下 [[email protected] ~]# systemctl status mariadb ● mariadb.service - MariaDB 10.2.30 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─

MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案

===========================================================二,忘记本地root的登录密码解决过程:1.编辑/mysql/my.ini在[mysqld] 配置部分添加一行skip-grant-tables 2.保存后重启mysql[[email protected] etc]# service mysqld restartShutting down MySQL.                                      

连接mysql报错:error 2003 (hy000):can't connect to mysql server on 'localhost' (10061)

一.mysql 的bin目录下有个MySQLInstanceConfig.exe,运行就可以进行创建数据库实例,创建实例时也可以生成windows 服务,把服务设置成自动启动就可以了 二.安装在D盘的discuzz!打开后出现上述错误,请问应如何处理?winmysqladmin已经启动,但三色树上有一个小红点如果出现"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)",说明你的MySQL还没有启动.解决办法

mysql报错:MySQL server version for the right syntax to use near 'type=InnoDB'

工作中使用sql语句建表时,mysql报了如下错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1 解决方案: 这个报错是由于某些版本的mysql不支持type写法,将type关键词改成ENGINE 即可. 版权声明:本文为博主原

长久不用的mysql报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

mac上安装过mysql: 然而,尝试连接时报错: $ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 尝试去查看mysql.socket文件,发现没有.. $ which mysql /usr/local/bin/mysql 然后试试重启mysql: $ mysql.server start

PHP连接MySQL报错:SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' (2)

如下所示,PHP连接MySQL报错: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'MySQL' (2) 测试代码如下: <?php try { $dsn = 'mysql:dbname=php-note;host=localhost;port=3306;charset=utf8'; $username = 'root'; $password = 'root'; new PDO( $dsn,