+ -
当前位置:首页 → 问答吧 → ubuntu 10.04 修改my.cnf后导致mysql服务无法启动的问题

ubuntu 10.04 修改my.cnf后导致mysql服务无法启动的问题

时间:2011-09-28

来源:互联网

我用一个最为简单的测试程序分别在x86机和ARM板上跑了下(当然db库和程序都交叉编译过了),结果在x86机上完全正常的程序,到ARM板上就跑挂了:
在x86机上正常输出:
dbp->put:
dbp->get:
get from db: hello,world
dbp closed

在ARM板上,出现严重错误:
dbp->put:
dbp->get:
BDB0058 page 87122432: illegal page type or format
BDB0061 PANIC: Invalid argument
get from db: (null)
BDB0060 PANIC: fatal region error detected; run recovery
dbp closed

我的main如下:
#include <stdio.h>
#include <string.h>
#include "db.h"
int main()
{
DB *dbp = NULL;
int ret = 0;
DBT key, data;
char my_key[] = {"1001"};
char my_data[] = {"hello,world"};

ret = db_create(&dbp, NULL, 0);
ret = dbp->open(dbp, NULL, "local.db", NULL, DB_BTREE, DB_CREATE, 0);

memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));

key.data = (char *)my_key;
key.size = strlen(my_key) + 1;
data.data = (char *)my_data;
data.size = strlen(my_data) + 1;

printf("dbp->put:\n");
ret = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE);
dbp->sync(dbp, 0);

memset(&data, 0, sizeof(DBT));
printf("dbp->get:\n");
dbp->get(dbp, NULL, &key, &data, 0);
printf("get from db: %s\n", (char *)data.data);

if (ret < 0)
{
printf("######### error #########\n");
}

dbp->close(dbp, 0);
printf("dbp closed\n");
}
复制代码求高人指教,错误出在哪了?

作者: syd2011   发布时间: 2011-09-28