解決ERROR 1030 (HY000): Got error 168 from storage engine apparmor
MySQL建表時指定另外一個目錄,結果出錯:
mysql> create table t1 (id int primary key,n varchar(10)) data directory='/home/mysql/data'; ERROR 1030 (HY000): Got error 168 from storage engine
在error log中有這樣的提示:
2020-01-16T02:29:45.360317Z 2 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2020-01-16T02:29:45.360400Z 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
以為是mysqld的許可權不對,改了也沒有用:
mysql> system sudo -u mysql touch /home/mysql/data/a mysql> create table t1 (id int primary key,n varchar(10)) data directory='/home/mysql/data'; ERROR 1030 (HY000): Got error 168 from storage engine
到處搜尋,發現是apparmor惹得禍,
# aa-status| grep mysql /usr/sbin/mysqld /usr/sbin/mysqld (15007)
修改配置檔案把相應的目錄加上即可: /etc/apparmor.d/usr.sbin.mysqld
或者disable mysqld的
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
Skipping profile in /etc/apparmor.d/disable: usr.sbin.mysqld
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70018393/viewspace-2900232/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Got error 28 from storage engine 解決方法GoError
- 記錄一次常見的錯誤:java.sql.SQLException: Got error 28 from storage engineJavaSQLExceptionGoError
- MySQL ERROR 1031 (HY000) at line 33: Table storage engine forMySqlError
- mysql主從同步失敗Last_IO_Error: Got fatal error 1236 from master解決方法MySql主從同步ASTErrorGo
- 解決docker: Error response from daemon故障DockerError
- ERROR 1290 (HY000) 解決辦法Error
- mysqldump Got error: 1045MySqlGoError
- MySQL:ERROR 1286 (42000): Unknown storage engine 'MyISAM'MySqlError
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- Got fatal error 1236 from master when reading data from binary logGoErrorAST
- MySQL ERROR Got an error reading communication packetsMySqlErrorGo
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- mysqldump Got error 1290MySqlGoError
- An error from listenerError
- 【Mysql】Slave_IO_Running: No---Got fatal error 1236 from masterMySqlGoErrorAST
- 【MySQL】Got fatal error 1236原因和解決方法MySqlGoError
- Failed to read auto-increment value from storage engineAIREM
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- ERROR 1010 (HY000): Error dropping databaseErrorDatabase
- mysql執行sql指令碼報錯ERROR 1366 (HY000) 解決MySql指令碼Error
- ERROR2002(HY000):CantconnecttolocalMySQLserverthroughsocket的解決方法ErrorMySqlServer
- ERROR 1548 (HY000): Cannot load from mysql.proc. The table is probably corruptedErrorMySql
- MySQL主從複製報錯:Got fatal error 1236 from master when reading data fromMySqlGoErrorAST
- 解決docker啟動映象報錯:docker: Error response from daemonDockerError
- ERROR 1114 (HY000): The table 'test1' is full 的解決Error
- MySQL ERROR 1366(HY000):Incorrect string value:''for column''at row 1解決方案MySqlError
- MySQL 亂碼實戰解決ERROR 1366 (HY000): Incorrect string value: 'MySqlError
- MySQL "ERROR 1010(HY000):Error dropping database(canMySqlErrorDatabase
- ERROR 1524 (HY000): Plugin is not loadedErrorPlugin
- ASP.NET MVC got 405 error on HTTP DELETE requestASP.NETMVCGoErrorHTTPdelete
- 【已解決】Error filter ListenerStartErrorFilter
- alter table engine=memory ERROR 1114Error
- 帝國CMS提示parse error syntax error的解決方法Error
- tar: Error exit delayed from previous errorsError
- ERROR 1114 (HY000) The table '' is fullError
- MYSQL ERROR 2003 (HY000) CanMySqlError
- mysql 8 報錯 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryMySqlErrorAIStruct
- 如何解決"Parse error: syntax error"Error