ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)--MySQL错误

时间:2020-12-02 13:50:40

MySQL错误整理:

错误一:

ERROR  (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

2、解决方法(摘自:http://wenda.haosou.com/q/1364099334067193?src=150

、先查看 /etc/rc.d/init.d/mysqld status 看看mysql是否已经启动.
另外看看是不是权限问题.
、确定你的mysql.sock是不是在那个位置,
mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock
、试试:service mysqld start

 错误二:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

解决方法参考:

MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因 - 潇湘隐者 - 博客园 http://www.cnblogs.com/kerrycode/p/4368312.html

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)--MySQL错误的更多相关文章

  1. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)-mysql.sock丢失解决方案

    我们的LAMP是搭建在UBUNTU 12.04 LTS上的. LAMP是通过编译的方式进来安装的. 在一次处理意外挂机时由于未知的原因在重启后发现无法连接数据库了, 在打开网站时出现如下的的提示: E ...

  2. mysql之ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决方法

    LAMPP安装完成之后,mysql -u root -p连不上,报这个错误: ERROR 2002 (HY000): Can't connect to local MySQL server throu ...

  3. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'解决

    用XAMPP装装好mysql之后,mysql -uroot 连不上,报这个错误:   ERROR 2002 (HY000): Can't connect to local MySQL server t ...

  4. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...

  5. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    从供应商手中接手一个云平台(Windwos Azure)上的MySQL数据库,登录数据库时遇到错误: $mysql -uroot -p Enter password: ERROR 2002 (HY00 ...

  6. ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var mysql 启动不了(转载)

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var mysql 启动不了   ps -A | gr ...

  7. Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法

    我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL serv ...

  8. linux云服务器mysql ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

    一早上过来发现网站打开报错,数据库连接不上.. 有人改密码? putty进去,mysql -uroot -p 输入密码后,报错 ERROR 2002 (HY000): Can't connect to ...

  9. 更换mysql数据目录后出现ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 的解决办法

    服务器上的mysql默认数据目录为/var/lib/mysql/,同时服务器的/空间不是很大,而近期又有大量的日志需要导入进行分析,时常搞得/的空间捉襟见肘,晚上一狠心就想把mysql的数据目录转移到 ...

  10. 启动mysql错误ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ ( ...

随机推荐

  1. XVII Open Cup named after E.V. Pankratiev. GP of SPb

    A. Array Factory 将下标按前缀和排序,然后双指针,维护最大的右边界即可. #include<cstdio> #include<algorithm> using ...

  2. &lbrack;译&rsqb;如何防止elasticsearch的脑裂问题

    本文翻译自blog.trifork.com的博文 地址是http://blog.trifork.com/2013/10/24/how-to-avoid-the-split-brain-problem- ...

  3. michael的沟通秘籍

    1 多准备几个邮件模板2 lower expectation over delivery less promise extra give3 involve resource earliar 尽早接手公 ...

  4. SQL Server 2008维护计划 出错 无法实现自动备份

    ,MaintenancePlan.Subplan_1,错误,0,HBZGQ\TESTSQLSERVER,MaintenancePlan.Subplan_1,(作业结果),,该作业失败. 用户 sa 调 ...

  5. Linux 基本命令学习笔记

    1. 文件管理 Ø touch  新建文件.例: touch test.txt  新建一个test.txt 文件. Ø cp 复制文件.例:cp ./user_one/test_one  ./user ...

  6. 成都Uber优步司机奖励政策(3月5日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  7. mysql 中文乱码的解决办法

    I would not suggest Richies answer, because you are screwing up the data inside the database. You wo ...

  8. seajs源码

    /*** Sea.js 3.0.0 | seajs.org/LICENSE.md 中文注释由 李祥威 添加,为个人对细节的理解,官方解释很详细的地方就不说了 难免有错漏,联系我: chuangweil ...

  9. &lbrack;ZJOI 2010&rsqb;Perm 排列计数

    Description 题库链接 询问有多少个 \(1\sim N\) 的排列 \(P\) 满足" \(\forall i\in[2,N], P_i>P_{\frac{i}{2}}\) ...

  10. dp&comma;px&comma;pt&comma;sp 的区别 以及dp 和 px 互转

    dp = dip : device independent pixels(设备独立像素). 不同设备有不同的显示效果,这个和设备硬件有关,一般我们为了支持WVGA.HVGA和QVGA 推荐使用这个,不 ...