MacOS无法启动MySQL Server [英] MacOS Can't start MySQL Server

查看:450
本文介绍了MacOS无法启动MySQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有MacOS Sierra.我已经安装了正在运行的MySQL Server,但是,在Mac Book重新启动后,我无法启动MySQL Server.

I have MacOS Sierra. I have installed MySQL Server which has been working, however, after a reboot of the Mac Book, I cannot start the MySQL Server.

我尝试将my.cnf文件中的端口从3306更改为3307.

I have tried changing the port from 3306 to 3307 in the my.cnf file.

问题

我将非常感谢您提供有关如何启动MySQL Server的帮助,并希望它能在MacOS Boot up上自动启动.

I would appreciate any help on how to start the MySQL Server, and also have it so it starts automatically on MacOS Boot up.

(我是Mac的新手,所以很抱歉,如果这是一个基本问题).

(I am new to Mac, so apologies if this is a basic question).

更新

正在寻找错误日志,今天(2017年2月2日)的时间戳我找不到任何东西.

Looking for error logs, I can't find anything with todays (2/2/2017) timestamp.

data目录中没有任何内容:

Nothing in the data dir:

自从我尝试启动MySQL服务器(2017年2月2日之后09:00)以来,没有修改带有"mysql"的文件.

No files with "mysql" have been modified since I've tried to start the MySQL Server (2/2/2017 after 09:00).

推荐答案

与Richard讨论后,以下解决了该问题:

After a discussion with Richard, the following solves the issue:

my.cnf:

[client]

port = 3306
socket = /tmp/mysql.sock


[mysqld]

port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql-5.7.17-macos10.12-x86_64/data
tmpdir = /tmp

从本质上讲,尽管我们已将相关节添加到my.cnf文件中,但仍会错过该节的标题.添加[mysqld]部分允许mysql启动.

Essentially, although we'd added the relevant stanza's to the my.cnf file, we'd still missed the section heading. Adding the [mysqld] section allowed mysql to start.

这篇关于MacOS无法启动MySQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆