【问题标题】:Error in MySQL v5.7.11 installation after compilingMySQL v5.7.11 编译后安装报错
【发布时间】:2016-07-12 12:03:03
【问题描述】:

在从源代码编译安装后尝试启动 mysql 服务器时,我在 MAC OS X 10.11 中遇到以下错误。 keyring_file 不可读。

我尝试使用以下命令启动服务器。

./mysqld start

终端产生以下错误。

2016-03-24T18:43:50.591772Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-03-24T18:43:50.592053Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-03-24T18:43:50.592091Z 0 [Note] ./mysqld (mysqld 5.7.11) starting as process 3470 ...
2016-03-24T18:43:50.593833Z 0 [Warning] Can't create test file /usr/local/mysql/data/Hemens-MacBook-Pro-2.lower-test
2016-03-24T18:43:50.593852Z 0 [Warning] Can't create test file /usr/local/mysql/data/Hemens-MacBook-Pro-2.lower-test
2016-03-24T18:43:50.595428Z 0 [ERROR] Plugin keyring_file reported: 'keyring_file initialization failure. Please check if the keyring_file_data points to readable keyring file or keyring file can be created in the specified location. The keyring_file will stay unusable until correct path to the keyring file gets provided'
2016-03-24T18:43:50.595860Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-24T18:43:50.595866Z 0 [Note] InnoDB: Uses event mutexes
2016-03-24T18:43:50.595881Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-03-24T18:43:50.595884Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-03-24T18:43:50.596157Z 0 [Note] InnoDB: Number of pools: 1
2016-03-24T18:43:50.596319Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-03-24T18:43:50.605257Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-03-24T18:43:50.615154Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-03-24T18:43:50.631296Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-03-24T18:43:50.638315Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-03-24T18:43:50.638358Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2016-03-24T18:43:50.638364Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2016-03-24T18:43:50.638369Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2016-03-24T18:43:50.638373Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2016-03-24T18:43:50.638377Z 0 [ERROR] InnoDB: Cannot open datafile './ibtmp1'
2016-03-24T18:43:50.638381Z 0 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2016-03-24T18:43:50.638385Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2016-03-24T18:43:50.954042Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-03-24T18:43:50.954098Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-03-24T18:43:50.954119Z 0 [ERROR] Failed to initialize plugins.
2016-03-24T18:43:50.954126Z 0 [ERROR] Aborting

2016-03-24T18:43:50.954141Z 0 [Note] Binlog end
2016-03-24T18:43:50.954223Z 0 [Note] Shutting down plugin 'CSV'
2016-03-24T18:43:50.954232Z 0 [Note] Shutting down plugin 'keyring_file'
2016-03-24T18:43:50.954507Z 0 [Note] ./mysqld: Shutdown complete

【问题讨论】:

    标签: mysql macos file-permissions


    【解决方案1】:

    如果您检查keyring_file_data mysql manual entry,您将看到此选项的含义:

    用于安全数据存储的数据文件的路径名 密钥环文件插件。文件位置应在目录中 仅供 keyring_file 插件使用。例如,做 找不到数据目录下的文件。

    不要对多个 MySQL 使用相同的 keyring_file 数据文件 实例。每个实例都应该有自己唯一的数据文件。

    默认文件名为 keyring,位于 特定于平台,取决于 INSTALL_LAYOUT CMake 的值 选项,如下表所示。指定默认值 如果您是从源代码构建,则显式文件的目录,请使用 INSTALL_MYSQLKEYRINGDIR CMake 选项。

    您还将看到各种 Linux 发行版如何处理它的默认值。

    /var/lib/mysql-keyring/keyring

    所以答案应该是可以安全忽略。但是,如果您希望 innodb 文件加密 my.cnf 看起来像这样:

    [mysqld]
    keyring_file_data = /var/lib/mysql-keyring/keyring
    

    但是这可能无法解决您的问题。

    1. 这是一个不属于 stackoverflow 的问题,但可能是 serverfault。
    2. 这是一个权限问题。您是否将 mysql 数据目录设置为运行 mysqld 的用户?

    【讨论】:

      猜你喜欢
      • 2012-11-03
      • 2017-03-02
      • 2015-11-27
      • 1970-01-01
      • 2021-07-13
      • 2017-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多