发新话题
打印

Freebsd 6.1下安装后不能启动问题的解决

Freebsd 6.1下安装后不能启动问题的解决

Freebsd 6.1下安装后不能启动问题的解决


陈海青(joson chen) http://www.chq.name

一、运行环境... 1

二、故障描述:... 1

三、原因分析:... 1

四、解决办法:... 1

五、相关资料... 2



一、运行环境
OS: Freebsd 6.1,

DB:mysql 4.0

二、故障描述:
在freebsd中安装了mysql4.1后,卸载,又安装mysql4.0,安装成功,但是不能启动,在错误日志报错如下:

060831  5:49:04 r/local/libexec/mysqld: Can't open file: 'host.MYI'. (errno: 142)

060831  5:49:04 Fatal error: Can't open privilege tables: File '/usr/local/share/mysql/charsets/?.c

onf' not found (Errcode: 2)

060831  5:49:04 Aborting



连接数据库报错:ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)



错误日志的路径:

一般在/var/db/mysql目录下

三、原因分析:
这是因为降级安装后,数据库系统表不会重新安装,于是mysql4.0读取原来安装的mysql4.1的系统表,导致出现问题。

四、解决办法:
1:备份原来的 /var/db/mysql目录

2:卸载安装mysql4.0

3:删除原来的 /var/db/mysql目录

4:重新安装mysql4.0

5:运行命令:/usr/local/etc/rc.d/mysql-server start

更简单的办法:

1:备份原来的 /var/db/mysql目录

2:删除原来的 /var/db/mysql目录

3:运行命令:/usr/local/etc/rc.d/mysql-server start

因为/usr/local/etc/rc.d/mysql-server start会自动重建mysql系统数据库,日志如下:

060831 06:36:53  mysqld started

InnoDB: The first specified data file ./ibdata1 did not exist:

InnoDB: a new database to be created!

060831  6:36:53  InnoDB: Setting file ./ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait...

060831  6:36:54  InnoDB: Log file ./ib_logfile0 did not exist: new to be created

InnoDB: Setting log file ./ib_logfile0 size to 5 MB

InnoDB: Database physically writes the file full: wait...

060831  6:36:54  InnoDB: Log file ./ib_logfile1 did not exist: new to be created

InnoDB: Setting log file ./ib_logfile1 size to 5 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Doublewrite buffer not found: creating new

InnoDB: Doublewrite buffer created

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

060831  6:36:55  InnoDB: Started

TOP

发新话题