安装 macports 后无法启动 mysql 服务器

安装 macports 后无法启动 mysql 服务器
150213 16:12:31 mysqld_safe mysqld from pid file /opt/local/var/[hostname].local.pid ended
150213 16:21:09 mysqld_safe Starting mysqld daemon with databases from /opt/local/var
150213 16:21:09 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
150213 16:21:09 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/ is case insensitive
150213 16:21:09 [Note] Plugin 'FEDERATED' is disabled.
150213 16:21:09 [Note] Plugin 'ndbcluster' is disabled.
/opt/local/libexec/mysqld: Table 'mysql.plugin' doesn't exist
150213 16:21:09 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150213 16:21:09  InnoDB: Initializing buffer pool, size = 8.0M
150213 16:21:09  InnoDB: Completed initialization of buffer pool
150213 16:21:09  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: 'create'.
InnoDB: Cannot continue operation.
150213 16:21:10 mysqld_safe mysqld from pid file /opt/local/var/[hostname].local.pid ended

似乎 mysqld.sock 没有在 /tmp 中创建,/opt/local/var/run/mysql5 中没有符号链接,我无法弄清楚 InnoDB 权限问题出了什么问题。文件夹和内容是用户 mysql、组 mysql。而且“mysql_upgrade”也无法启动服务器。

任何帮助都值得感激!

谢谢

答案1

Innodb 引擎抱怨它无法创建 ibdata1 文件(存储所有数据的地方)。我知道您说您检查了权限,但您确定这是正确的目录吗?找到您的 mysqld 二进制文件并发出./mysqld --help --verbose并找到datadir变量。此目录是 mysql 用户需要写访问权限的地方。试试看。

相关内容