码迷,mamicode.com
首页 > 数据库 > 详细

Mac brew 安装mysql 报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

时间:2015-08-30 17:37:36      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:brew   mysql   安装   

安装mysql 最新版 56

brew install mysql

启动报错

ben:~ soul$ which mysql
/usr/local/bin/mysql
ben:~ soul$ mysql
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)

解决办法

运行

ben:~ soul$ mysql.server start
Starting MySQL
. SUCCESS! 
ben:~ soul$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.26 Homebrew

设置 mysql 自启动

设置 mysql root 密码

ben:~ soul$ ls /usr/local/bin | grep mysql --color
msql2mysql
mysql
mysql.server
mysql_client_test
mysql_client_test_embedded
mysql_config
mysql_config_editor
mysql_convert_table_format
mysql_embedded
mysql_find_rows
mysql_fix_extensions
mysql_install_db
mysql_plugin
mysql_secure_installation
mysql_setpermission
mysql_tzinfo_to_sql
mysql_upgrade
mysql_waitpid
mysql_zap
mysqladmin
mysqlbinlog
mysqlbug
mysqlcheck
mysqld
mysqld_multi
mysqld_safe
mysqldump
mysqldumpslow
mysqlhotcopy
mysqlimport
mysqlshow
mysqlslap
mysqltest
mysqltest_embedded
ben:~ soul$ 
ben:~ soul$ mysql_secure_installation

关键命令 mysql_secure_installation

(欢迎交流 default.fu@foxmail.com)

版权声明:本文为博主原创文章,未经博主允许不得转载。

Mac brew 安装mysql 报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

标签:brew   mysql   安装   

原文地址:http://blog.csdn.net/default7/article/details/48105807

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!