zabbix连接Mysql提示Can’t connect to local MySQL server through socket的解决方法
要解决此错误,有两种解决方法:
1、将连接参数“host”的值由“localhost”改成“127.0.0.1”;

- 2、按下面方法,在“/etc/mysql.cnf”中指定“sock文件”位置:
#vi /etc/my.cnf
[mysqld]
datadir=/storage/db/mysql
socket=/storage/db/mysql/mysql.sock
[client]
socket=/storage/db/mysql/mysql.sock
补充:
zabbix到安装界面报错" Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock"
解决办法:
#ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock #创建一个软连接
zabbix连接Mysql提示Can’t connect to local MySQL server through socket的解决方法的更多相关文章
- 连接Mysql提示Can’t connect to local MySQL server through socket的解决方法
mysql,mysqldump,Mysqladmin,php连接mysql服务常会提示下面错误: ERROR 2002 (HY000): Can't connect to local MySQL se ...
- 启动Mysql服务提示Can’t connect to local MySQL server through socket的解决方法
启动Mysql服务常会提示下面错误: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/ ...
- Can’t connect to local MySQL server through socket的解决方法
http://www.aiezu.com/db/mysql_cant_connect_through_socket.html mysql,mysqldump,php连接mysql服务常会提示下面错误: ...
- 【转】pam_mysql - MySQL error (Can't connect to local MySQL server through socket
转自:http://350201.blog.51cto.com/340201/1034672 参照 http://wjw7702.blog.51cto.com/5210820/936244博 主做的p ...
- Mac下安装Mysql出现 Can’t connect to local MySQL server through socket '/tmp/mysql.sock'
在Mac下安装mysql出现 Can't connect to local MySQL server through socket '/tmp/mysql.sock' 错误,解决如下: $ unset ...
- MAC中Django中runserver提示Can't connect to local MySQL server through socket '/tmp/mysql.sock错误
好像不止遇到一次,直接Google就可以了,在stackoverflow中就有答案,答案就是你没有开MySQL - -. stackoverflow链接见 http://stackoverflow.c ...
- 关于使用deepin在linux下安装mysql出现Can't connect to local MySQL server through socket '/tmp/mysql/mysql.sock' (2)的解决方法
根据目录/etc/mysql打开文件debain.cnf 此时文本里的内容为 # Automatically generated for Debian scripts. DO NOT TOUCH![c ...
- Ubuntu14.04 安装MySQL 及Can‘t connect to local MYSQL server through socket ’/var/run/mysqld/mysqld.sock‘ (2)
今天安装Mysql 按着这个①http://www.cnblogs.com/zhuyp1015/p/3561470.html来安装,却出现了这个问题 卸载又从安装还是有问题, 搜了好久在stackov ...
- 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' ...
- mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
mysql Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ 今天在linux中安装了mys ...
随机推荐
- 把Excel自动转换Json格式
Excel表格转JSON 在实际工作中,我们常常使用Excel记录各种数据,但在各种应用系统传输数据却使用JSON格式,这就需要把Excel转为JSON.如果能把数据转换传输过程自动化就更完 ...
- SX【2020.01.09】NOIP提高组模拟赛(day1)
[2020.01.09]NOIP提高组模拟赛(day1) 这次考得不理想,只做了前两题,后两题没时间做,说明做题速度偏慢. source : 100 + 20 + 0 + 0 = 120 rank7 ...
- python之路76 路飞项目 企业项目类型、软件开发流程、路飞项目需求、pip永久换源、虚拟环境、路飞项目前后端创建、包导入、后端项目目录调整
知识获取渠道 cnblogs csdn 掘金 思否 找工作app boss直骗.拉钩.智联.猎聘.脉脉(内推,hr). 企业项目类型 1.面向互联网用户:商城类项目 微信小程序商城 2.面向互联网用户 ...
- 初学 Socket.io
概念 Socket.io 是一个支持客户端和服务器之间的低延迟.双向和基于事件的通信的库,除了支持 JavaScript 以外,还支持 Java.Python.Golang. Socket.io 构建 ...
- 01#Web 实战:雷达图
成品演示 绘制雷达图 雷达图里外层 function calcPolygonX(radarX, radius, increaseAngle) { return radarX + radius * Ma ...
- ERROR: Functions in index expression must be marked IMMUTABLE
在创建函数索引时遇到报错,报错信息即为标题,下面是详细信息. 1 表定义 1234567 skytf=> \d test_39; Table "skytf.test_39" ...
- 2021-08-17:cocos creator 如何控制 spine 动画的进度
// 传入spine与进度比例(注意初始要把spine的TimeScale设置为0)updateSpine(spine: sp.Skeleton,rate: number) { const track ...
- UVM——callback机制应用示例
对应代码: 1.在UVM组件中主操作函数或者任务之前或者之后内嵌callback函数或任务 1 class driver extends uvm_driver #(transaction); 2 `u ...
- bootstrapTable的一些属性
url : 'firmSoftTable.action', // 请求后台的URL(*) method : 'post', // 请求方式(*)post/get contentType: " ...
- golang 中使用mysql报错:“ scannable dest type slice with >1 columns (4) in result”
query := fmt.Sprintf("SELECT .... infos = make([]*struct, 0, 10) err = s.db.GetContext(ctx, &am ...