解決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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL:ERROR 1286 (42000): Unknown storage engine 'MyISAM'MySqlError
- ERROR 1290 (HY000) 解決辦法Error
- MySQL案例09:Last_IO_Error: Got fatal error 1236 from master when reading data from binary logMySqlASTErrorGo
- 解決docker: Error response from daemon故障DockerError
- mysqldump Got error: 1045MySqlGoError
- mysqldump Got error 1290MySqlGoError
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- MySQL主從複製報錯:Got fatal error 1236 from master when reading data fromMySqlGoErrorAST
- Failed to read auto-increment value from storage engineAIREM
- ERROR 1114 (HY000) The table '' is fullError
- 解決docker啟動映象報錯:docker: Error response from daemonDockerError
- Error!: SQLSTATE[HY000] [2002] Connection refusedErrorSQL
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- mysql 8 報錯 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryMySqlErrorAIStruct
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- Error: error:0308010C:digital envelope routines::unsupported 解決方案ErrorGit
- 帝國CMS提示parse error syntax error的解決方法Error
- HBuilder解決:Error: error:0308010C:digital envelope routines::unsupportedUIErrorGit
- python -- 解決字典【KEY ERROR】PythonError
- 【已解決】Error filter ListenerStartErrorFilter
- Error creating bean with name 解決ErrorBean
- 如何解決"Parse error: syntax error"Error
- 【Jenkins】data stream error|Error cloning remote repo ‘origin‘ 錯誤解決JenkinsErrorREM
- 【MySQL】ERROR 1878 (HY000): Temporary file write failure.MySqlErrorAI
- 解決IDEA Error:Output directory is not specifiedIdeaError
- ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECTError
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization paErrorMySqlServer
- PSQLException: ERROR: failed to find conversion function from unknown to charSQLExceptionErrorAIFunction
- Dynamics CRM CRM Reporting Error: Error occurred while fetching the data extension的解決方法ErrorWhile
- 解決 "Script Error" 的另類思路Error
- Manjaro解決 Node.JS Error: ENOSPCJARNode.jsError
- error: use of deleted function ‘YYSTYPE::YYSTYPE()’[解決]ErrordeleteFunction
- DedeCMS Error: Tag disabled: "php" 解決方法ErrorPHP
- PHP curl error 60 錯誤解決PHPError
- 阿里雲mysql遠端登入報ERROR 2027(HY000)阿里MySqlError
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables optErrorMySqlServer