免费注册 查看新帖 |

Chinaunix

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

[服务应用] 请教mysql启动报错的问题[结贴] [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-08-05 16:45 |只看该作者 |倒序浏览
本帖最后由 pzw1985 于 2013-08-06 10:07 编辑
  1. [root@centos ~]# lsb_release -a
  2. LSB Version:    :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
  3. Distributor ID: CentOS
  4. Description:    CentOS release 5.9 (Final)
  5. Release:        5.9
  6. Codename:       Final
复制代码
我把本来自带的mysql删除后安装了mysql-5.5.30
  1. [root@centos ~]# mysql --version
  2. mysql  Ver 14.14 Distrib 5.5.30, for Linux (i686) using readline 5.1
复制代码
在启动mysql的时候出现这样的错误:
  1. [root@centos ~]# service mysql start
  2. Starting MySQL...The server quit without updating PID file (/var/lib/mysql/centos.com.pid).
复制代码
机器名:
  1. [root@centos mysql]# hostname
  2. centos.com
复制代码
路径:
  1. [root@centos mysql]# pwd
  2. /var/lib/mysql
复制代码
错误日志:
  1. [root@centos mysql]# cat centos.com.err
  2. 130805 16:32:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
  3. 130805 16:32:12 [Note] Plugin 'FEDERATED' is disabled.
  4. /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
  5. 130805 16:32:12 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
  6. 130805 16:32:12 InnoDB: The InnoDB memory heap is disabled
  7. 130805 16:32:12 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
  8. 130805 16:32:12 InnoDB: Compressed tables use zlib 1.2.3
  9. 130805 16:32:12 InnoDB: Using Linux native AIO
  10. 130805 16:32:12 InnoDB: Initializing buffer pool, size = 128.0M
  11. 130805 16:32:12 InnoDB: Completed initialization of buffer pool
  12. 130805 16:32:12 InnoDB: highest supported file format is Barracuda.
  13. 130805 16:32:12  InnoDB: Waiting for the background threads to start
  14. 130805 16:32:13 InnoDB: 5.5.30 started; log sequence number 2785101
  15. 130805 16:32:13 [Note] Recovering after a crash using mysql-bin
  16. 130805 16:32:13 [Note] Starting crash recovery...
  17. 130805 16:32:13 [Note] Crash recovery finished.
  18. 130805 16:32:13 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
  19. 130805 16:32:13 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
  20. 130805 16:32:13 [Note] Server socket created on IP: '0.0.0.0'.
  21. 130805 16:32:13 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/proxies_priv.frm' (errno: 13)
  22. 130805 16:32:13 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/proxies_priv.frm' (errno: 13)
  23. 130805 16:32:13 mysqld_safe mysqld from pid file /var/lib/mysql/centos.com.pid ended
复制代码
请问问题出现在哪里啊?Google找了很多方案都没有解决。。

论坛徽章:
4
双子座
日期:2014-08-28 10:08:002015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:58:112015年亚洲杯之阿联酋
日期:2015-03-13 03:25:15
2 [报告]
发表于 2013-08-05 17:06 |只看该作者
看了一下应该都是路径的问题,你可以看一下service mysql start 对应的命令是什么,估计里面指定的路径不对

论坛徽章:
0
3 [报告]
发表于 2013-08-05 17:10 |只看该作者
回复 2# weishuo1999


    请问什么叫对应的命令啊 ?

论坛徽章:
4
双子座
日期:2014-08-28 10:08:002015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:58:112015年亚洲杯之阿联酋
日期:2015-03-13 03:25:15
4 [报告]
发表于 2013-08-05 17:12 |只看该作者
你看一下/etc/init.d/下面的mysqld的脚本,也就是说你执行service mysql start 真实执行的是什么

应该类似是/usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock  这样的一个命令   你看看你的是什么?

然后找找看报错的文件是否不存在   还是路径错了

论坛徽章:
0
5 [报告]
发表于 2013-08-05 17:21 |只看该作者
回复 4# weishuo1999


    /etc/init.d/mysql 这个内容太多了,搜索你的关键字也没有找到相关的信息。。

论坛徽章:
4
双子座
日期:2014-08-28 10:08:002015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:58:112015年亚洲杯之阿联酋
日期:2015-03-13 03:25:15
6 [报告]
发表于 2013-08-05 17:24 |只看该作者
呃   。。。 看了一下我自己的,关键代码在这  
$exec   --datadir="$datadir" --socket="$socketfile" \
        --pid-file="$mypidfile" \
        --basedir=/usr --user=mysql >/dev/null 2>&1

你看看你有没有,echo出来看看 。
ps: 都是shell脚本,仔细看看能看懂吧

论坛徽章:
0
7 [报告]
发表于 2013-08-06 10:06 |只看该作者
回复 6# weishuo1999


    谢谢你!
问题解决了,是因为/var/lib/mysql/mysql这个目录下面有很多文件的所有者和组不是mysql用户
  1. -rw------- 1 root root   8947 Jul  3 10:28 tables_priv.frm
复制代码
把权限改了就能启动了。。
谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP