如何重新启动mysql以及my.cnf文件在哪里

Nic*_*ilt 6 mysql

我使用的是Mac OS X Snow Leopard Apple电脑.

我使用此处提到的说明在我的机器上安装了MySQL .一切都很好.但是我有两个问题.

  1. my.cnf文件在哪里?我搜索了整个文件系统,结果为空.可能没有my.cnf,MySQL可以使用默认值.如果是的话那么很可能我应该创建my.cnf/etc/mysql.是对的吗?

  2. 如何重启MySQL服务器?我知道当我重新启动机器时它就开始了.这是plist的样子.mysqld_safe不让我重启服务器.

    KeepAlive Label com.mysql.mysqld Program/usr/local/mysql/bin/mysqld_safe RunAtLoad UserName mysql WorkingDirectory/usr/local/mysql

Kei*_*all 8

从mysql附带的示例my.cnf:

# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/data) or
# ~/.my.cnf to set user-specific options.
Run Code Online (Sandbox Code Playgroud)

在我的OS X 10.4实例上,my.cnf位于/etc/my.cnf.

要重新启动mysql,请使用mysqladmin将其关闭,然后使用mysqld_safe再次启动它:

/usr/local/mysql/bin/mysqladmin -uroot -p shutdown
sudo /usr/local/mysql/bin/mysqld_safe &
Run Code Online (Sandbox Code Playgroud)