[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. Passwordless SSH Login

    原文地址:http://manjeetdahiya.com/2011/03/03/passwordless-ssh-login/ Consider two machines A and B. We w ...

  2. Java 时间和字符换的处理

    /** * * @param timeStr 时间字符串 * @param diff 与起始值差距,单位为毫秒 * @throws ParseException */ public String de ...

  3. 在redis一致性hash(shard)中使用lua脚本的坑

    redis 2.8之前的版本,为了实现支持巨量数据缓存或者持久化,一般需要通过redis sharding模式来实现redis集群,普遍大家使用的是twitter开源的Twemproxy. twemp ...

  4. embarcadero radstudio xe5 正式版 下载地址

    http://altd.embarcadero.com/download/radstudio/xe5/delphicbuilder_xe5_win.iso

  5. BSTestRunner——一个丑在路上的python unnitest HTML报告生成Runner

    今天忽然看到HTMLTestRunner的样式,第一眼的感觉是样式有点过时了,稍微看了下源码,果然最后更新时间是几年前,由于实现比较简单,所以顺手将样式改一下. 效果图 设计思想 既然有UI,那么如果 ...

  6. Android QQ空间浏览图片动画特效的实现(※)

    1 http://blog.csdn.net/yangblocker/article/details/12680247 2 photoview 3 nineoldandroid

  7. Android 中ViewPagerIndicator的使用

    1.https://github.com/JakeWharton/Android-ViewPagerIndicator 2.http://blog.csdn.net/xiaanming/article ...

  8. OAuth介绍

    1.认识OAUTH OAUTH协议为用户资源的授权提供了一个安全的.开放而又简易的标准.与以往的授权方式不同之处是OAUTH的授权不会使第三方触及到用户的帐号信息 (如用户名与密码),即第三方无需使用 ...

  9. Unity3d插件汇总

    Unity3d 中的svn插件 插件下载地址:http://www.dehome.net/down/viewfile.php?file_id=53

  10. php 图片添加文字水印 以及 图片合成(微信快码传播)

    1.图片添加文字水印: $bigImgPath = 'backgroud.png'; $img = imagecreatefromstring(file_get_contents($bigImgPat ...