编译mysql出错:Can't create/write to file '/usr/local/mysql/var/mysql/db.MYI' (Errcod

wzwen 2011-04-09 10:53:13
安装的mysql版本是:mysql-5.1.48

以前在debian5上面编译很顺利,这次换debian6,就不行了

贴下编译参数:
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install

执行下面这步时出错:
/usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql

出错提示:

root@206412:~# /usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql
Installing MySQL system tables...
ERROR: 1 Can't create/write to file '/usr/local/mysql/var/mysql/db.MYI' (Errcode: 13)
110409 14:46:58 [ERROR] Aborting

110409 14:46:58 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete


Installation of system tables failed! Examine the logs in
/usr/local/mysql/var for more information.

You can try to start the mysqld daemon with:

shell> /usr/local/mysql/libexec/mysqld --skip-grant &

and use the command line tool /usr/local/mysql/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /usr/local/mysql/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/mysql/var that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/mysql/scripts/mysqlbug script!




请问这个该怎么解决?问题出在哪里呢?
...全文
1679 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wzwen 2011-04-11
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 t5500 的回复:]

创建mysql用户和组了吗?
http://dev.mysql.com/doc/refman/5.1/zh/installing.html#quick-install
[/Quote]

创建了,我贴下全部步骤吧

./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install

groupadd mysql
useradd -g mysql mysql
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
sed -i 's/skip-locking/skip-external-locking/g' /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql
rucypli 2011-04-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 t5500 的回复:]
#chown -R mysql:mysql /usr/local/mysql/
[/Quote]
乌镇程序员 2011-04-10
  • 打赏
  • 举报
回复
rucypli 2011-04-10
  • 打赏
  • 举报
回复
Examine the logs in
/usr/local/mysql/var for more information.

wzwen 2011-04-10
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 t5500 的回复:]

#chown -R mysql:mysql /usr/local/mysql/
[/Quote]

不行啊.还是同样的错误提示...
iihero_ 2011-04-10
  • 打赏
  • 举报
回复
#chown -R mysql:mysql /usr/local/mysql/

+2
wzwen 2011-04-10
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 rucypli 的回复:]

.err文件
[/Quote]

没看到错误日志文件哦
rucypli 2011-04-10
  • 打赏
  • 举报
回复
.err文件
wzwen 2011-04-10
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 rucypli 的回复:]

Examine the logs in
/usr/local/mysql/var for more information.
[/Quote]

这个目录下有这几个文件:
mysql mysql-bin.000001 mysql-bin.000002 mysql-bin.000003 mysql-bin.000004 mysql-bin.000005 mysql-bin.index test

像mysql-bin.000005文件打开是一行乱码,看不到内容。。。
ACMAIN_CHM 2011-04-09
  • 打赏
  • 举报
回复
先检查一下权限。
乌镇程序员 2011-04-09
  • 打赏
  • 举报
回复
#chown -R mysql:mysql /usr/local/mysql/

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧