2015-04-26 59 views
-3

昨天,我的本地sql服務器崩潰了,並且在嘗試重新啓動它之後,我有一個典型的錯誤顯示我這是一個權限問題。但試圖解決它,我讓它變得更糟。現在我仍然有權限問題,但我不知道如何解決它。無法重新啓動mysql本地服務器

這就是我拿到後我做了MySQL的重新啓動:

mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied) 
2015-04-26 12:48:32 1663 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 
2015-04-26 12:48:32 1663 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2015-04-26 12:48:32 1663 [Note] InnoDB: The InnoDB memory heap is disabled 
2015-04-26 12:48:32 1663 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2015-04-26 12:48:32 1663 [Note] InnoDB: Memory barrier is not used 
2015-04-26 12:48:32 1663 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2015-04-26 12:48:32 1663 [Note] InnoDB: Using CPU crc32 instructions 
2015-04-26 12:48:32 1663 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2015-04-26 12:48:32 1663 [Note] InnoDB: Completed initialization of buffer pool 
2015-04-26 12:48:32 1663 [Note] InnoDB: Highest supported file format is Barracuda. 
2015-04-26 12:48:32 1663 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463 
2015-04-26 12:48:32 1663 [Note] InnoDB: Database was not shutdown normally! 
2015-04-26 12:48:32 1663 [Note] InnoDB: Starting crash recovery. 
2015-04-26 12:48:32 1663 [Note] InnoDB: Reading tablespace information from the .ibd files... 
2015-04-26 12:48:32 7fff72404300 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: Error: could not open single-table tablespace file ./test/cities.ibd 
InnoDB: We do not continue the crash recovery, because the table may become 
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. 
InnoDB: To fix the problem and start mysqld: 
InnoDB: 1) If there is a permission problem in the file and mysqld cannot 
InnoDB: open the file, you should modify the permissions. 
InnoDB: 2) If the table is not needed, or you can restore it from a backup, 
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal 
InnoDB: crash recovery and ignore that table. 
InnoDB: 3) If the file system or the disk is broken, and you cannot remove 
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf 
InnoDB: and force InnoDB to continue crash recovery here. 
+0

從設置權限開始。 – panther

+0

數據文件夾具有以下權限:drwxrwxrwx 11 _mysql _mysql 374 26 avr 12:48數據。這不正確嗎? – johnmalkovitch

回答

0

固定它,我跑以下命令:

sudo chown -R $(whoami) /usr/local/mysql-5.6.22-osx10.8-x86_64/data 

MySQL的文件夾缺少權限。