我使用ports的方式安裝了 mysql server 5.0.27 后,執(zhí)行了 mysql_install_db,但是,執(zhí)行 mysqld 啟動(dòng)命令:
#cd /usr/local ; /usr/local/bin/mysqld_safe &
顯示為:
Starting mysqld daemon with databases from /var/db/mysql
STOPPING server from pid file /var/db/mysql/host173.xxx.com.pid
071121 16:22:28 mysqld ended
[1] Done ( cd /usr/local; /usr/local/bin/mysqld_safe )
# cat /var/db/mysql/xxx.rpm8.com.err
071121 16:22:27 mysqld started
071121 16:22:28 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
071121 16:22:28 mysqld ended
注:以上都是用root權(quán)限進(jìn)行的操作。
請(qǐng)幫助我查找一下原因。謝謝;作者: geyun616 時(shí)間: 2007-11-21 16:32
貌似mysql啟動(dòng)時(shí)會(huì)以某用戶的身份來(lái)運(yùn)行的,所以說(shuō)并不是你用root跑,就一定是root用戶的權(quán)限。
我沒(méi)用ports裝過(guò)mysql,所以不確定他默認(rèn)的用戶是否是root作者: geyun616 時(shí)間: 2007-11-21 16:35
| Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 |
select * from user的結(jié)果,全是y了。。。作者: cnhero 時(shí)間: 2007-11-21 16:41 標(biāo)題: 回復(fù) #2 geyun616 的帖子 問(wèn)題解決了;
我發(fā)現(xiàn) /var/db/mysql 的屬主是 root,就 chown -R mysql /var/db/mysql
這樣就解決了問(wèn)題;
謝謝幫助!作者: geyun616 時(shí)間: 2007-11-21 16:56
原帖由 cnhero 于 2007-11-21 16:41 發(fā)表
問(wèn)題解決了;
我發(fā)現(xiàn) /var/db/mysql 的屬主是 root,就 chown -R mysql /var/db/mysql