Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101900459
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Mysql/postgreSQL

2008-04-19 18:04:13

作者:lg    来自:

mysql service在啟動的時候都會顯示
Timeout error occurred trying to start MySQL Daemon.

底下是/var/log/mysqld.log

040508 01:48:04 mysqld ended

040508 01:48:07 mysqld started
Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
If you do not want to use transactional InnoDB tables, add a line
skip-innodb
to the [mysqld] section of init parameters in your my.cnf
or my.ini. If you want to use InnoDB tables, add to the [mysqld]
section, for example,
innodb_data_file_path = ibdata1:10M:autoextend
But to get good performance you should adjust for your hardware
the InnoDB startup options listed in section 2 at

/usr/libexec/mysqld: ready for connections

mysql 支援幾種資料表格式 myisam,innodb..等
而你的組態檔中innodb的部分設定有誤,於是mysql告訴你起始錯誤

解決方法如下




修改 /etc/rc.d/init.d/mysqld

if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]; then
break;
else
sleep 1;
fi
done
if !([ -n "`/usr/bin/mysqladmin ping 2> /dev/null`" ]); then
echo "Timeout error occurred trying to start MySQL Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi


將以上兩個 ping 的後面各加上 -u

if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n "`/usr/bin/mysqladmin ping -u 2> /dev/null`" ]; then
break;
else
sleep 1;
fi
done
if !([ -n "`/usr/bin/mysqladmin ping -u 2> /dev/null`" ]); then
echo "Timeout error occurred trying to start MySQL Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi

這樣就可以了.
阅读(464) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~