Mysql 5.6在Mac OS中无法运行

时间:2016-07-19 13:00:29

标签: mysql macos mysql-5.6

Mysql 5.6在Mac OSX中不断出现问题。

它经常断开服务器的连接。

抛出某些错误,例如def find(userID: UUID) = { val query = for { dbUser <- slickUsers.filter(_.id === userID.toString) dbUserLoginInfo <- slickUserLoginInfos.filter(_.userID === dbUser.id) dbLoginInfo <- slickLoginInfos.filter(_.id === dbUserLoginInfo.loginInfoId) } yield (dbUser, dbLoginInfo) db.run(query.result).map { results => var loginList = List[LoginInfo]() results.foreach { case (user, loginInfo) => loginList = LoginInfo(loginInfo.providerID, loginInfo.providerKey) :: loginList } results.headOption.map { case (user, loginInfo) => User( UUID.fromString(user.userID), loginList, user.firstName, user.lastName, user.fullName, user.email, user.avatarURL) } } 并不存在

与通过DMG安装的Mysql 5.6.14相同:/tmp/mysql.sock

$ mysql ERROR 2013 (HY000): Lost connection to MySQL server at 'sending authentication information', system error: 32错误。

我必须每次都删除进程ID,然后再次运行authentication packet lost

但同样的事情一再发生。

1 个答案:

答案 0 :(得分:0)

即使任何网站上的在线答案都不起作用,也不要担心。试试这个,它对我和我的所有队友都很有吸引力。

1)。在mac中安装atom。

2)。运行sudo atom /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

您可能会看到类似这样的代码

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <false/>
    <key>ExitTimeOut</key>
    <integer>600</integer>
    <key>GroupName</key>
    <string>_mysql</string>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.oracle.oss.mysql.mysqld</string>
    <key>LaunchOnlyOnce</key>
    <false/>
    <key>ProcessType</key>
    <string>Interactive</string>
    <key>Program</key>
    <string>/usr/local/mysql/bin/mysqld</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/mysql/bin/mysqld</string>
        <string>--user=_mysql</string>
        <string>--basedir=/usr/local/mysql</string>
        <string>--datadir=/usr/local/mysql/data</string>
        <string>--plugin-dir=/usr/local/mysql/lib/plugin</string>
        <string>--log-error=/usr/local/mysql/data/mysqld.local.err</string>
        <string>--pid-file=/usr/local/mysql/data/mysqld.local.pid</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>SessionCreate</key>
    <true/>
    <key>UserName</key>
    <string>_mysql</string>
    <key>WorkingDirectory</key>
    <string>/usr/local/mysql</string>
</dict>
</plist>

然后在</array>

上方添加这两行
<string>--port=3306</string>
<string>--innodb_file_per_table=0</string>

然后重启mysql服务器。那就是它。