2013-12-13 71 views
2

我想改變mysql上的數據目錄。但得到以下錯誤:CentOS上的文件操作中的操作系統錯誤13號?

121213 04:40:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 
121213 04:41:00 mysqld_safe Starting mysqld daemon with databases from /home/mysql_data 
121213 4:41:00 [Warning] Can't create test file /home/mysql_data/localhost.lower-test 
121213 4:41:00 [Warning] Can't create test file /home/mysql_data/localhost.lower-test 
121213 4:41:00 InnoDB: Initializing buffer pool, size = 8.0M 
121213 4:41:00 InnoDB: Completed initialization of buffer pool 
121213 4:41:00 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: 'open'. 
InnoDB: Cannot continue operation. 

我已經閱讀了許多網站上的權限問題。所以請告訴我如何執行這些操作,因爲我不太瞭解linux。

謝謝。

回答

2

錯誤號13 ==權限被拒絕。

你可以看到在/usr/include/sys/errno.h的完整列表。

在你的地方,我測試了與

sudo mysqld -s /bin/bash 

試圖在MySQL(/var/lib/mysql)的目錄改變,如果我不能創建/刪除存在的東西,這裏是事故的原因問題。可能你可以通過chown/chmod命令來解決這個問題,如果有些事情不重要,我會等待你的意見。