Ubuntu MySQL:作业无法启动

时间:2016-01-10 08:36:44

标签: mysql ubuntu

我的Google Cloud服务器硬盘空间不足。所以我添加了另一个已安装的HDD,我复制了MySQL数据的内容(/ var / lib / mysql / *)。在我尝试重新启动MySQL时更新my.cnf后,它失败了以下错误:

160110 14:10:40 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use$
160110 14:10:40 [Note] Plugin 'FEDERATED' is disabled.
^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160110 14:10:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160110 14:10:40 InnoDB: The InnoDB memory heap is disabled
160110 14:10:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160110 14:10:40 InnoDB: Compressed tables use zlib 1.2.8
160110 14:10:40 InnoDB: Using Linux native AIO
160110 14:10:40 InnoDB: Initializing buffer pool, size = 128.0M
160110 14:10:40 InnoDB: Completed initialization of buffer pool
160110 14:10:40  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.
160110 14:10:41 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use$
160110 14:10:41 [Note] Plugin 'FEDERATED' is disabled.
^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160110 14:10:41 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160110 14:10:41 InnoDB: The InnoDB memory heap is disabled
160110 14:10:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160110 14:10:41 InnoDB: Compressed tables use zlib 1.2.8
160110 14:10:41 InnoDB: Using Linux native AIO
160110 14:10:41 InnoDB: Initializing buffer pool, size = 128.0M
160110 14:10:41 InnoDB: Completed initialization of buffer pool
160110 14:10:41  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.
160110 14:10:42 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use$
160110 14:10:42 [Note] Plugin 'FEDERATED' is disabled.
^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160110 14:10:42 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160110 14:10:42 InnoDB: The InnoDB memory heap is disabled
160110 14:10:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160110 14:10:42 InnoDB: Compressed tables use zlib 1.2.8
160110 14:10:41 InnoDB: Using Linux native AIO
160110 14:10:41 InnoDB: Initializing buffer pool, size = 128.0M
160110 14:10:41 InnoDB: Completed initialization of buffer pool
160110 14:10:41  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.
160110 14:10:42 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use$
160110 14:10:42 [Note] Plugin 'FEDERATED' is disabled.
^G/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
160110 14:10:42 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
160110 14:10:42 InnoDB: The InnoDB memory heap is disabled
160110 14:10:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160110 14:10:42 InnoDB: Compressed tables use zlib 1.2.8
160110 14:10:42 InnoDB: Using Linux native AIO
160110 14:10:42 InnoDB: Initializing buffer pool, size = 128.0M
160110 14:10:42 InnoDB: Completed initialization of buffer pool
160110 14:10:42  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.

我已尝试chmod 777并将mysql:mysql chown到已挂载的文件夹(/ var / www / html / DB /),但结果相同。使用chown之后,我甚至可以看到所有者现在是mysql。那么为什么MySQL无法访问该文件夹呢?

我在这里看到过类似的问题,但大部分接受的答案都是重新安装MySQL。这对我来说不是解决方案。它只是绕过了这个问题。还有更好的答案吗?

1 个答案:

答案 0 :(得分:0)

您是否可以检查是否已将所有配置文件设置为必须在my.cnf中更改目录路径

另外请确保您更改了mysqld的配置文件,这意味着您必须更新AppArmor配置文件,以便获取新目录。

点击此链接https://blogs.oracle.com/jsmyth/entry/apparmor_and_mysql

我希望这会有效!!