MySQL 无法启动:touch:./data/mysql/xxx.local.err:没有此文件或目录

MySQL 无法启动:touch:./data/mysql/xxx.local.err:没有此文件或目录

我的操作系统是 OS X,我通过 安装了 MySQL Percona。MySQLbrew的错误日志是/usr/local/var/mysql/xxx.local.err。之后我尝试运行mysql_install_db并重新启动机器。好的,但现在我在 syslog 中看到

Aug 17 03:17:47 xxx com.apple.launchd.peruser.501[247] (homebrew.mxcl.percona-server[29906]): Exited with code: 1
Aug 17 03:17:47 xxx com.apple.launchd.peruser.501[247] (homebrew.mxcl.percona-server): Throttling respawn: Will start in 10 seconds
Aug 17 03:17:58 xxx com.apple.launchd.peruser.501[247] (homebrew.mxcl.percona-server[30026]): Exited with code: 1
Aug 17 03:17:58 xxx com.apple.launchd.peruser.501[247] (homebrew.mxcl.percona-server): Throttling respawn: Will start in 10 seconds
...

好的,我尝试手动运行它:

$ /usr/lo/usr/local/opt/percona-server/bin/mysqld_safe

130817 03:14:07 mysqld_safe Logging to './data/mysql/xxx.local.err'.
touch: ./data/mysql/xxx.local.err: No such file or directory
chmod: ./data/mysql/xxx.local.err: No such file or directory
130817 03:14:07 mysqld_safe Starting mysqld daemon with databases from ./data/mysql
/usr/local/opt/percona-server/bin/mysqld_safe: line 135: ./data/mysql/xxx.local.err: No such file or directory
/usr/local/opt/percona-server/bin/mysqld_safe: line 172: ./data/mysql/xxx.local.err: No such file or directory
touch: ./data/mysql/xxx.local.err: No such file or directory
chown: ./data/mysql/xxx.local.err: No such file or directory
chmod: ./data/mysql/xxx.local.err: No such file or directory
130817 03:14:07 mysqld_safe mysqld from pid file ./data/mysql/xxx.local.pid ended
/usr/local/opt/percona-server/bin/mysqld_safe: line 135: ./data/mysql/xxx.local.err: No such file or directory

我有两个问题:

  1. 为什么错误日志的位置从 更改/usr/local/var/mysql/xxx.local.err./data/mysql/xxx.local.err
  2. 我该如何修复它?创建目录/usr/lo/usr/local/opt/percona-server/bin/data/mysql并不能解决问题。

答案1

第一个问题的答案:

当你编译一个程序时,你使用"configure --prefix=your primative path"configure命令能够对你的程序的各个路径、你的维护者mysql server、单独的路径log files, pid file, binary files, sbin,等等进行分类。

第二个问题的答案:

在 my.cnf 中,您可以更改pid file. socket filebasedirdatadirtmpdir的路径lc-messages-dir

相关内容