免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4616 | 回复: 9
打印 上一主题 下一主题

MYSQL无法启动 并出现了极其严重的错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-24 14:39 |只看该作者 |倒序浏览
我装的是FedoraCore7在图形化界面安装的MySQL的全部11个包(yum install)
现在无论如何都无法启动

求助于各位大侠!是跪求!
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost ~]# /etc/rc.d/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
启动 MySQL:                                               [失败]

于是查看日志:
mysqld.log

080724 14:23:39  mysqld started
080724 14:23:39  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
080724 14:23:39  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./localhost.localdomain.err
InnoDB: File operation call: 'stat'.
InnoDB: Error: os_file_readdir_next_file() returned -1 in
InnoDB: directory .
InnoDB: Crash recovery may have failed for some .ibd files!
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
080724 14:23:39  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080724 14:23:39  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080724 14:23:40  InnoDB: Started; log sequence number 0 43655
080724 14:23:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:23:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:23:40 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:23:40  mysqld ended

080724 14:24:43  mysqld started
080724 14:24:43  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
080724 14:24:43  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./localhost.localdomain.err
InnoDB: File operation call: 'stat'.
InnoDB: Error: os_file_readdir_next_file() returned -1 in
InnoDB: directory .
InnoDB: Crash recovery may have failed for some .ibd files!
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
080724 14:24:43  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 36808.
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080724 14:24:43  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080724 14:24:44  InnoDB: Started; log sequence number 0 43655
080724 14:24:44 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:24:44 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:24:44 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
080724 14:24:44  mysqld ended

是权限问题吗? 我一切都是在root下操作的啊 数据库还没有别的用户
我也运行了 mysql_install_db --user=root 还是不能启动
find -name host.frm 也的确没找到
谢谢各位大侠!跪谢!

论坛徽章:
0
2 [报告]
发表于 2008-07-24 18:42 |只看该作者
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
应该是权限问题。
有没新建mysql用户和用户组?

论坛徽章:
0
3 [报告]
发表于 2008-07-24 21:30 |只看该作者

回复 #1 嘿呀 的帖子

大概是你的配置文件里mysql.sock的路径不对

看看/etc下,my.cnf文件,里面是不是有
/var/lib/mysql/mysql.sock

改成/tmp/mysql.sock试试,

这个问题俺遇到过,google 下,不难解决

:)

论坛徽章:
0
4 [报告]
发表于 2008-07-24 22:35 |只看该作者
注意看 /var 下面 mysql 相关的权限,以前我也遇到过一次,把权限重新设了就好了

论坛徽章:
0
5 [报告]
发表于 2008-07-25 13:53 |只看该作者
真是谢谢楼上几位,这个论坛算回复最有价值的!赞!

不过仍存在问题
设置了权限 也更改了my.cnf

[root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql
[root@localhost mysql]# cd /
[root@localhost /]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost /]# vi /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
# socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

SElinux也关了,google的方法都试过了,都没有用,所以感到很奇怪
谢谢大家,求助中~~~

(安装是图形化的添加软件安装的,不是安装下载的rpm包更不是编译源码安装的,没想到却还是有问题,所以感觉太菜了,linux恶补中~)

论坛徽章:
0
6 [报告]
发表于 2008-07-25 15:52 |只看该作者
你的mysqld已经启动了一个进程.所以你再启动就出现了Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

ps aux|grep  mysql
看一下

论坛徽章:
0
7 [报告]
发表于 2008-07-27 13:55 |只看该作者

回楼上 谢谢!仍问题

# ps aux|grep  mysql
root      2074  0.0  0.1   6052  1252 ?        S    13:44   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/tmp/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
mysql     2134  0.0  2.1 136096 16864 ?        Sl   13:44   0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/tmp/mysql.sock
root      3269  0.0  0.0   5372   696 pts/0    R+   13:51   0:00 grep mysql

[root@localhost ~]# /etc/rc.d/init.d/mysqld status
mysqld (pid 2134) 正在运行...
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

论坛徽章:
1
寅虎
日期:2015-01-23 02:35:47
8 [报告]
发表于 2008-07-27 14:33 |只看该作者
装好了有没有初始化库,看看有没有mysql那个库

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
9 [报告]
发表于 2008-07-27 14:59 |只看该作者
配置修改后重启mysql了吗?

论坛徽章:
0
10 [报告]
发表于 2008-07-27 15:27 |只看该作者
原帖由 嘿呀 于 2008-7-27 13:55 发表
# ps aux|grep  mysql
root      2074  0.0  0.1   6052  1252 ?        S    13:44   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/tmp/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
mysql     2134  0.0  2.1 136096 16864 ?        Sl   13:44   0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/tmp/mysql.sock
root      3269  0.0  0.0   5372   696 pts/0    R+   13:51   0:00 grep mysql

[root@localhost ~]# /etc/rc.d/init.d/mysqld status
mysqld (pid 2134) 正在运行...
[root@localhost ~]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket ’/var/lib/mysql/mysql.sock' (2)


发现没有?mysql.sock路径不一样,说明你系统里可能装了2个mysql,配置不一样,你把mysql的完整路径也给出,再登陆
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP