[root@host2 ~]# mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@host2 ~]# /etc/init.d/mysql status
ERROR! MySQL is running but PID file could not be found

查看MYSQL进程:
ps aux | grep mysql
然后KILL进程
kill -9 pid1 pid2 …

[root@host2 ~]# ps aux | grep mysql
root 1813 0.0 0.0 108336 68 ? S Jul14 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/host2.pid
mysql 1918 0.0 19.5 1076608 197440 ? Sl Jul14 0:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/host2.err --pid-file=/var/lib/mysql/host2.pid
root 2982 0.0 0.0 103256 844 pts/3 S+ 00:09 0:00 grep mysql
[root@host2 ~]# kill -9 1813 1918

再启动MYSQL
/etc/init.d/mysql start
检查mysql运行状态
/etc/init.d/mysql status

成功!

登陆mysql时提示异常的解决方法的更多相关文章

  1. .net安装部署“Error 1001 在初始化安装时发生异常” 的解决方法

    状况描述:打包安装后,如果删除安装目录中的某个文件,这时从桌面快捷方式启动软件系统会自动运行修复程序,此时因为路径问题会报出“错误 1001 在初始化安装时发生异常xxx”的异常.(前提是你的安装部署 ...

  2. 树莓派安装 MySQL 时出现错误的解决方法

    今天被要求解决一个树莓派无法正常安装 MySQL 的问题.以下是解决过程记录. 我在 Mac 上利用 SSH 连接到树莓派,执行 sudo apt-get install mysql-server m ...

  3. 当freemarker中EL表达式的值为空时出现异常的解决方法

     <#list pageView.list as msg>      <form name="msgForm" id="msgForm" ...

  4. 连接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 ...

  5. 引擎崩溃、异常、警告、BUG与提示总结及解决方法

    http://www.58player.com/blog-635-128.html [Unity3D]引擎崩溃.异常.警告.BUG与提示总结及解决方法   此贴会持续更新,都是项目中常会遇到的问题,总 ...

  6. 启动mysql时显示:/tmp/mysql.sock 不存在的解决方法

    启动mysql时显示:/tmp/mysql.sock 不存在的解决方法 启动mysql时报错的解决(mysql 5.0.45 redhat as 43)  ====================== ...

  7. 启动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/ ...

  8. PHP提示Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法

    这篇文章主要介绍了PHP提示Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法,是在进行PHP数据库程序开发中常会遇 ...

  9. 关于php读mysql数据库时出现乱码的解决方法

    关于php读mysql数据库时出现乱码的解决方法 php读mysql时,有以下几个地方涉及到了字符集. 1.建立数据库表时指定数据库表的字符集.例如 create table tablename ( ...

随机推荐

  1. xml转换之

    1.XStream public static <T> T toBean(String xmlStr, Class<T> cls) { XStream xstream = ne ...

  2. isInstance和isAssignableFrom的用法

    String str = ""; Object o = new Object(); System.out.println(String.class.isInstance(o)); ...

  3. 单点登录 SSO(Single Sign-On)的实现原理

    为什么要 SSO? 企业的信息化过程是一个循序渐进的过程,这就造成在企业的不同时期,根据业务和发展需要,构建了多个应用程序,而这些应用程序在功能.设计和技术可能都有所不同,就形成了各自独立的用户库和用 ...

  4. Visual Studio 2010配置OpenGL-1.8

    参考博客 : 安装参考 1. http://blog.csdn.net/mooncircle/article/details/5545448 2. http://www.cnblogs.com/moo ...

  5. Gson 和 FastJson 性能测试

    使用版本: compile 'com.google.code.gson:gson:2.7' compile 'com.alibaba:fastjson:1.2.17' 评测样板为一个People数组, ...

  6. 安装mmseg出错 config.status: error: cannot find input file: src/Makefile.in

    aclocallibtoolize --forceautomake --add-missingautoconfautoheadermake clean

  7. Rsync 详细配置说明

    rsync是类unix系统下的数据镜像备份工具. 它的特性如下:可以镜像保存整个目录树和文件系统.可以很容易做到保持原来文件的权限.时间.软硬链接等等.无须特殊权限即可安装.快速:第一次同步时 rsy ...

  8. typeof instanceof 之间的区别总结

        typeof   它返回值是一个字符串,该字符串说明运算数的类型. a=1; b=true; c="c"; d=function(){ console.log(" ...

  9. Ubuntu 14.04 安装nVidia驱动后不能进入图形界面的恢复过程

    想要解决Ubuntu14.04的风扇不停的转的问题.由于ubuntu本身不支持双显卡切换,导致集显独显都处于开启状态,发热量和耗电量居高不下. 1. 安装驱动过程 参考[1]中的步骤,做了如下的操作. ...

  10. Raft论文的一些问题

    抛些问题出来,真正解释了这些问题才算理解了论文.:) 1. 什么是复制状态机 2. Raft vs Paxos 3. Raft的设计目标understandability,为达到设计目标在做设计时如何 ...