简体   繁体   English

Mysql 5.6在Mac OS中不起作用

[英]Mysql 5.6 is not working in Mac OS

Mysql 5.6 is constantly creating problem in Mac OSX. Mysql 5.6在Mac OSX中不断产生问题。

Its constantly disconnecting the server. 它不断断开服务器连接。

And throwing certain errors like /tmp/mysql.sock doesn't exist 并抛出诸如/tmp/mysql.sock类的某些错误,

The same with Mysql 5.6.14 installed via DMG: $ mysql ERROR 2013 (HY000): Lost connection to MySQL server at 'sending authentication information', system error: 32 与通过DMG安装的Mysql 5.6.14相同: $ mysql ERROR 2013 (HY000): Lost connection to MySQL server at 'sending authentication information', system error: 32

And authentication packet lost errors. 并且authentication packet lost错误。

I have to kill the process id every time and then had to run the mysql -u root -p all over again. 我必须每次都杀死进程ID,然后不得不再次运行mysql -u root -p

But same thing happens again and again. 但是同样的事情一次又一次地发生。

Don't worry even if none of the online answers in any website doesn't work. 即使任何网站上的在线答案都不起作用,也不必担心。 Try this, It worked for me and my all my team mates like a charm. 试试这个,它对我和我所有的队友都像魅力一样奏效。

1). 1)。 Install the atom in mac. 在Mac中安装Atom。

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

You might see code something like this 您可能会看到类似以下的代码

<?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>

Then add these two lines just above </array> 然后在</array>上方添加这两行

<string>--port=3306</string>
<string>--innodb_file_per_table=0</string>

Then restart the mysql server. 然后重启mysql服务器。 That's it. 而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM