问题描述:启动MySQL后,出现连接不上,报 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
[root@mysql01 ~]# service mysql start
Starting MySQL [ OK ]
[root@mysql01 ~]# mysql -uroot -poracle
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@mysql01 ~]# ll /var/lib/mysql/mysql.sock
ls: cannot access /var/lib/mysql/mysql.sock: No such file or directory
说明:
mysqld.sock是mysql启动以后自动生成的文件,关闭MySQL服务后,这个文件又会被删除。如果MySQL启动异常,就有可能不生成这个文件,登录的时候就会出现你这个错误。
[root@mysql01 ~]# cd /var/lib/mysql
[root@mysql01 mysql]# ls
auto.cnf ib_logfile0 mysql01.err RPM_UPGRADE_MARKER-LAST
binarylog ib_logfile1 performance_schema test
ibdata1 mysql RPM_UPGRADE_HISTORY
[root@mysql01 mysql]# vi mysql01.err
错误日志报错如下:
2017-06-04 04:08:47 2835
2017-06-04 04:08:47 2835 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

分析:
1、磁盘空间目录不足
2、ibdata1 文件被其他的进程占用
3、 等

解决过程:
1、 -- 查看磁盘空间情况
[root@mysql01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 35G 7.8G 26G 24% /
tmpfs 699M 72K 699M 1% /dev/shm
/dev/sda1 2.9G 4.5M 2.7G 1% /tmp
2、 --InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
已经指出其他的线程启动已经在运行无法再次创建相关的读文件进程的权限,也就是说,现有的ibddata文件已经有人读取了,无法再次启动!
-- 查看系统 mysql 相关进程
[root@mysql01 ~]# ps aux |grep mysql*
root 1742 0.0 0.0 108336 552 ? S 03:59 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/mysql01.pid
mysql 1930 0.2 37.8 1170956 541948 ? Sl 03:59 0:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/mysql01.err --pid-file=/var/lib/mysql/mysql01.pid --port=3306
root 3117 0.0 0.0 103312 876 pts/2 S+ 04:29 0:00 grep mysql*
-- kill -9 杀掉
[root@mysql01 ~]# kill -9 1930
[root@mysql01 ~]# ps aux |grep mysql*
root 3186 0.0 0.0 103308 852 pts/2 S+ 04:29 0:00 grep mysql*
-- 启动
[root@mysql01 ~]# service mysql start
Starting MySQL.. [ OK ]
[root@mysql01 ~]# mysql -uroot -poracle
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
说明:恢复正常

mysql之 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11的更多相关文章

  1. 从ext4将mysql数据目录移动至lustre出现(InnoDB: Unable to lock ./ibdata1, error: 38.)

    因为数据目录过大,因此我把目录从本地移到了共享存储中.在修改了/etc/my.cnf和/etc/init.d/mysqld之后发现数据库可以运行,但启动速度很慢 原因是原文件系统是ext4,而目标文件 ...

  2. mysql_install_db出错,Unable to lock /usr/local/mysql/var/ibdata1, error: 11

    今天,在一台旧机器上编译一个新的Mysql,install时出了错: /usr/local/mysql_5615/scripts/mysql_install_db --user=mysql --bas ...

  3. InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!

    问题描述: centos 安装MySQL $yum install mysql-server 安装之后执行命令mysql 报错: 查看mysql的启动日志: [ERROR] InnoDB: auto- ...

  4. [ERROR] InnoDB: ibdata1 different size (rounded down to MB)

    启动mysql实例报错,查看 error log ## 错误信息2018-08-31T10:38:36.945081Z 0 [ERROR] InnoDB: The Auto-extending inn ...

  5. XAMPP 启动mysql报错 InnoDB: Error: could not open single-table tablespace file……

    昨天安装了最新版本XAMPP for Windows 1.8.3. 今天早上打开XAMPP双击mysql Start按钮报错,如下(部分截取): 2013-09-17 10:12:02 9012 [E ...

  6. elasticsearch报错[WARN ][bootstrap ] Unable to lock JVM Memory: error=12,reason=Cannot allocate memory,解决

    早上在服务器上安装elasticsearch集群,在其中的一台上面安装好elasticsearch之后安装了一些插件,其中一个插件是marvel,结果可能是新版本不支持这个插件,就没有安装成功,也就索 ...

  7. MySQL · 引擎特性 · InnoDB index lock前世今生

    http://mysql.taobao.org/monthly/2015/07/05/ MySQL · 引擎特性 · InnoDB index lock前世今生 前言 InnoDB并发过程中使用两类锁 ...

  8. 《mysql技术内幕 InnoDB存储引擎(第二版)》阅读笔记

    一.mysql架构 mysql是一个单进程多线程架构的数据库. 二.存储引擎 InnoDB: 支持事务 行锁 读操作无锁 4种隔离级别,默认为repeatable 自适应hash索引 每张表的存储都是 ...

  9. Mysql技术内幕——InnoDB存储引擎

    Mysql技术内幕——InnoDB存储引擎 http://jingyan.baidu.com/article/fedf07377c493f35ac89770c.html 一.mysql体系结构和存储引 ...

随机推荐

  1. 【leetcode刷题笔记】Number of 1 Bits

    Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also know ...

  2. MODBUS协议 一种问答方式的通信协议

    源:MODBUS协议 一种问答方式的通信协议 ModBus通信系统协议

  3. Linux环境下的图形系统和AMD R600显卡编程(2)——Framebuffer、DRM、EXA和Mesa简介

    转:https://www.cnblogs.com/shoemaker/p/linux_graphics02.html 1. Framebuffer Framebuffer驱动提供基本的显示,fram ...

  4. win7 与 Ubuntu 16.04 文件传送

    win7 与 Ubuntu 16.04 文件传送 环境:主机系统为win7,虚拟机为vmware12, 虚拟系统为ubuntu 16.04 方案一: 通过虚拟机vmware的共享文件夹实现. 方案二: ...

  5. Python 条件判断语句(if ,elif, else)

    条件判断可以分: 单分支判断:只有一个if语句 双分支判断:if else 的格式 多分支判断:if elif  else 的格式 条件语句嵌套判断 # 下面是个条件多分支判断 score = 85 ...

  6. CentOS防火墙iptables-config的相关配置参数详解

    默认/etc/sysoncifg/iptables-config的配置内容: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 ...

  7. 【[NOI2011]智能车比赛】(建图+spfa+坑爹精度)

    过了这题我就想说一声艹,跟这个题死磕了将近6个小时,终于是把这个题死磕出来了.首先看到这个题的第一反应,和当初做过的一个房间最短路比较相似,然后考虑像那个题那样建边,然后跑最短路.(具体建边方法请参考 ...

  8. sqoop学习2(数据导入与导出)

    最近学习了下这个导数据的工具,但是在export命令这里卡住了,暂时排不了错误.先记录学习的这一点吧 sqoop是什么 sqoop(sql-on-hadoop):是用来实现结构型数据(如关系型数据库) ...

  9. HDU 6096 AC自动机

    n个字符串 m个询问 每个询问给出前后缀 并且不重合 问有多少个满足 m挺大 如果在线只能考虑logn的算法 官方题解:对n个串分别存正序倒序 分别按照字典序sort 每一个串就可以被化作一个点 那么 ...

  10. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) C. Destroying Array

    C. Destroying Array time limit per test 1 second memory limit per test 256 megabytes input standard ...