Homebrew MariaDB 服务器启动错误与'mysql.server start'

Lee*_*Lee 4 mariadb mac-os-x

在 MacOS 10.13.6 上启动 MariaDB 10.3.8 时,会发生以下奇怪的行为:

mac:~user$ mysql.server start

Starting MariaDB
Run Code Online (Sandbox Code Playgroud)

.180813 17:50:11 mysqld_safe Logging to '/usr/local/var/mysql/mbp.local.err'.

180813 17:50:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql.. ERROR!
Run Code Online (Sandbox Code Playgroud)

在 ERROR 之前的输出中实际上还有更多的点!被陈列; 这个过程需要几分钟。奇怪的是服务器确实在运行。并且关机显示正常:

mac:~user$ mysql.server stop

Shutting down MariaDB.. SUCCESS!
Run Code Online (Sandbox Code Playgroud)

知道如何确定是什么导致启动时出现错误消息并修复它吗?

Jos*_*ine 5

我可以重现你的问题。不要mysql.server start在 macOS 中使用

如果您安装了 MariaDB homebrew,请使用brew services来启动和停止数据库。它只需要一秒钟,并且不会向标准输出写入奇怪的错误。

brew services stop mariadb
Stopping `mariadb`... (might take a while)
==> Successfully stopped `mariadb` (label: homebrew.mxcl.mariadb)

brew services start mariadb
==> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)
Run Code Online (Sandbox Code Playgroud)

Homebrew 中的服务概述:

brew services list
Name     Status  User     Plist
logstash stopped
mariadb  started Kim /Users/Kim/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
mysql    stopped
Run Code Online (Sandbox Code Playgroud)

一般帮助

brew services --help
brew services command:
    Integrates Homebrew formulae with macOS' launchctl manager.

    [sudo] brew services list
    List all running services for the current user (or root)

    [sudo] brew services run formula|--all
    Run the service formula without starting at login (or boot).

    [sudo] brew services start formula|--all
    Start the service formula immediately and register it to launch at login (or boot).

    [sudo] brew services stop formula|--all
    Stop the service formula immediately and unregister it from launching at login (or boot).

    [sudo] brew services restart formula|--all
    Stop (if necessary) and start the service immediately and register it to launch at login (or boot).

    [sudo] brew services cleanup
    Remove all unused services.

    If sudo is passed, operate on /Library/LaunchDaemons (started at boot).
    Otherwise, operate on ~/Library/LaunchAgents (started at login).
Run Code Online (Sandbox Code Playgroud)