一早上过来发现网站打开报错,数据库连接不上.. 有人改密码? putty进去,mysql -uroot -p 输入密码后,报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' 不是密码问题,百度主要有几个可能原因 1.my.cnf 配置问题,里面会设置 socket  /tmp/mysql.sock, 有说配置文件不存在,新建的 2.文件sock权限不够的 发现文件存…
[root@pisphkdcbsql01 mysql3307]# /opt/mysql3307/bin/mysql -upisp -ppisp@ mysql: [Warning] Using a password on the command line interface can be insecure. ERROR (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 解决办法 [ro…
登录服务器,使用root用户连接mysql时出现错误提示: $ bin/mysql -uroot -p Enter password: ERROR (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 尝试重启mysql $ ./mysql.server restart Shutting down MySQL (Percona Server)....... [ OK ] rm: cann…
我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 这个错是链接时报的错,要链接必须启动.修复的时候首先要启动mysql. 首先来了解一下 mysql.sock的作用: Mysql有两种连接方式: (1),TCP/IP (2),socket 对mysql.sock来说,其…
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 背景: mysql -uroot -p123456 提示: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 原因: mysql.sock文件是服务器与本地客户端进行通信的Uni…
版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/hjf161105/article/details/78850658 最近租了一个阿里云云翼服务器,趁着自己还是一个学生,享受一下优惠.我租的是阿里云Ubuntu16.04版本的服务器,在搭建mysql的时候,一开始是可以运行的,由于某次手抽,把mysql的套接字文件不小心删除了,然后无论怎么卸载重装,都出现了这个问题: root@iZufkfljcZ:~# mysql -uroot -p Ente…
Xtrabackup做备份时遇到下面错误信息MySQL server: Can't connect to local MySQL server through socket '/tmp/mysql.so'(2)   [root@MySQL-DB ~]# innobackupex --defaults-file=/usr/my.cnf --user=root --password=password  /mnt/resource/mysql_backup 160322 22:28:43 innoba…
首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2) 运行如下解决:参考 http://www.thinksaas.cn/group/topic/347978/ unset TMPDIR mysql_install_db --v…
1. 安装mysql但是从来没启动过,今天一启动就报错: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 其实是mysql服务没起来... localhost:~ miaoying$ mysql.server start Starting MySQL ... SUCCESS! 然后再去sudo mysql就行了. 2. 修改8.0以上版本的root密码 停止mysql服务: mysql.server…
输入 mysql -u root 登录 mysql 的时候出现以下错误: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 解决方法: touch /var/lib/mysql/mysql.sock      (如果目录里没有这个文件就手动创建) mysql.sock的路径可以查看/etc/my.cnf文件 chmod 777 /var/lib/mysql/my…