Mac failed to start a brew-installed MySQL solution

Source: Internet
Author: User

Recently re-installed Mac system, all the common software needs to be reinstalled again, no doubt install a brew is a good choice, about brew is what, how to install recommendations to brew official website to view, attached address: Brew Official website

After the installation is complete, it is particularly convenient to install additional software.

Perform:

Brew Install MySQL

When the successful installation is completed, the result is to log in with a bug:

ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock ' (2)

Search the web for half a day, find a solution, execute it in turn

Unset TMPDIR

"Bash mysql_install_db--verbose--user= root --basedir=" $ (brew--prefix MySQL) "--datadir=/usr/local/var/mysql-- Tmpdir=/tmp

Next start MySQL ' bashmysql.server start

You can log in when you start, and the login command is:

Mysql-uroot-p

Then prompted to enter the database password, the initial without the password in the case of direct carriage, entered the database

If you want to set up boot, execute the following command

Mkdir-p ~/library/launchagents
Cp/usr/local/cellar/mysql/5.6.16/homebrew.mxcl.mysql.plist ~/library/launchagents/#5.6.16 is the database version number, Modify it yourself according to the version number you installed at that time
Launchctl load-w ~/library/launchagents/homebrew.mxcl.mysql.plist

Done ~


Mac failed to start a brew-installed MySQL solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.