OSX 10.10 Yosemite 由mysql-5.6.21-osx10.9-x86_64.1.dmg
安装并且仅在in /usr/local/mysql
/etc or /usr/etc or ~/.my.cnf
sudo find / -name my.cnf
Password:
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/federated/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_big/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_binlog/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_rpl/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_team/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl/extension/bhs/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl_ndb/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/federated/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/ndb/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/ndb_big/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/ndb_binlog/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/ndb_rpl/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/ndb_team/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/rpl/extension/bhs/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/rpl/my.cnf
/Users/abc/Downloads/mysql-5.6.21-osx10.8-x86_64 2/mysql-test/suite/rpl_ndb/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/federated/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_big/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_binlog/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_rpl/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/ndb_team/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl/extension/bhs/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl/my.cnf
/usr/local/mysql-5.6.21-osx10.8-x86_64/mysql-test/suite/rpl_ndb/my.cnf
但是当我编辑文件时它无法正常工作。
并删除文件启动mysql服务器吧!
但mv my.cnf到/etc/my.cnf
服务器无法启动。
答案 0 :(得分:5)
我有完全相同的问题。然后我按照以下步骤解决了问题:
1)在文件夹/ usr / local / mysql中使用my.cnf而不是/ etc。你的mysql服务器无法启动的原因将在后面提到。
2)删除可写权限:
On Unix platforms, MySQL ignores configuration files that are world-writable. This is intentional as a security measure."
我使用了sudo chmod a-w my.cnf来删除该权限 我认为这是你的mysql服务器无法加载my.cnf的主要原因
3)修复my.cnf中的错误设置
当你将文件my.cnf移动到文件夹/ etc时,它被自动更改为不可写的权限,因此mysql服务器接受它。但是它可能有错误设置,因此无法启动。
您可以通过试错找到并修复问题,只需先注释所有行(在行的开头添加#),然后逐个打开并尝试重启mysql服务器以查找问题。在尝试时,有时你的mysql服务器无法再次启动,因为它已经加载到内存中但无法正常运行,尝试查找并终止其线程(我使用命令ps -A | Grep mysql查找)
在我的情况下,使用utf8bm4的任何设置都会导致崩溃。
希望有所帮助
答案 1 :(得分:0)
您的文件可能有错误,您可以尝试在文件为空的情况下启动数据库,并一次添加一个配置并查看服务器是否启动。
或许是权限问题。执行ls -al
以查看您拥有的权限。然后尝试sudo chmod 777 my.cnf
并查看是否有效......如果原来的权限不正确。