无法停止mysql(无法锁定。/ibdata1,错误:11)

无法停止mysql(无法锁定。/ibdata1,错误:11),mysql,Mysql,两天以来,我无法用我的根帐户连接到mysql。 我可以用其他帐户登录 我起初以为我的服务器被黑客攻击了,有人更改了密码。我试着重新设置它。为此,我必须使用mysqld_safe并因此停止mysql,但我没有做到: > sudo /etc/init.d/mysql stop Stopping MySQL database server: mysqld failed! > mysqld stop InnoDB: Unable to lock ./ibdata1, error: 11 I

两天以来,我无法用我的根帐户连接到mysql。 我可以用其他帐户登录

我起初以为我的服务器被黑客攻击了,有人更改了密码。我试着重新设置它。为此,我必须使用mysqld_safe并因此停止mysql,但我没有做到:

> sudo /etc/init.d/mysql stop
Stopping MySQL database server: mysqld failed!

> mysqld stop
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
130107 13:48:34  InnoDB: Unable to open the first data file
[...]
InnoDB: Error in opening ./ibdata1
130107 13:48:34  InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.1/...ror-codes.html
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
130107 13:48:34 [ERROR] Plugin 'InnoDB' init function returned error.
130107 13:48:34 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mysqld: Too many arguments (first extra is 'stop').
MySQL无法读取ibdata1,因此我检查其权限是否正确:

> ls -l /var/lib/mysql/
-rw-rw---- 1 mysql mysql 18874368 Jan  7 12:39 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Jan  7 13:05 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Jan  7 13:05 ib_logfile1
我试图移动和复制文件,但没有成功:

> mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak
> cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1
这是我的.cnf的一部分

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
LANGUAGE        = /usr/share/mysql/english
skip-external-locking
datadir是正确的

此外,以下是我尝试获取MySQL状态时发生的情况:

# sudo /etc/init.d/mysql status
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
我在上找到了此问题的解决方案,但我必须以root用户身份登录才能这样做,这是我无法做到的。我想这两个问题是有联系的

你们有人知道怎么解决这个问题吗?我的工作因此受阻

非常感谢您阅读此邮件,并可能回复此邮件


祝你今天愉快

如果这不是编程问题。。我不知道什么是。。我也有同样的问题你是对的,你没有。这与编程无关。这是一个服务器配置问题。