2016-07-06 214 views
0

如何在沒有root權限/寫入權限的情況下啓動mysql? 我收到以下錯誤沒有root權限的Mysql

host13:~/JS> mysqld start 
160706 18:06:31 [Warning] Can't create test file /tool/p64/.package/mysql-5.5.21/data/host13.lower-test 
160706 18:06:31 [Warning] Can't create test file /tool/p64/.package/mysql-5.5.21/data/host13.lower-test 
mysqld: Table 'mysql.plugin' doesn't exist 
160706 18:06:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
160706 18:06:31 InnoDB: The InnoDB memory heap is disabled 
160706 18:06:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins 
160706 18:06:31 InnoDB: Compressed tables use zlib 1.2.3 
160706 18:06:31 InnoDB: Initializing buffer pool, size = 128.0M 
160706 18:06:31 InnoDB: Completed initialization of buffer pool 
160706 18:06:31 InnoDB: Operating system error number 30 in a file operation. 
InnoDB: Error number 30 means 'Read-only file system'. 
InnoDB: Some operating system error numbers are described at 
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html 
InnoDB: File name ./ibdata1 
InnoDB: File operation call: 'create'. 
InnoDB: Cannot continue operation. 
+0

只讀文件系統不是特權問題。這意味着文件系統使用「ro」選項進行安裝,因此無人可以寫入。 – Barmar

回答

1

您可以將MySQL數據目錄到你能寫到哪,然後在/etc/my.cnf指定它(或可能取決於你的系統默認的另一個位置),參數爲datadir

如果你的數據目錄尚未初始化(在這種情況下mysqld會抱怨缺少授權表),你可以這樣創建它們:

mysql_install_db --datadir=$path_to_new_datadir 
+0

謝謝..我能用這個建議取得一些進展。 但是打到 '[錯誤]無法打開mysql.plugin表。請運行mysql_upgrade來創建它。 [錯誤]致命錯誤:無法打開並鎖定權限表:表'mysql.host'不存在' 是否有推薦的閱讀材料可以幫助我? – Jean

+0

編輯中包含的解決方案。 –

0

總結答案:

# Setup DB 
mysql_install_db --datadir=<FULL PATH TO STORE DB FILES> 

# Start server 
mysqld --datadir=<FULL PATH TO STORE DB FILES> 

# Shutdown server 
mysqladmin -u root shutdown 

備註:
1. =datadir之後 - 沒有這些命令將失敗
2.完整路徑d被使用