在osx上两次安装mysql? [英] two installs of mysql on osx?

查看:71
本文介绍了在osx上两次安装mysql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经运行 MySQL Ver 14.14 Distrib 5.6.10, for osx10.6 (x86_64) 一段时间了,没有任何问题.今晚我不得不硬重启笔记本电脑,启动一段时间后,我尝试访问开发数据库.我收到以下错误:

I've been running MySQL Ver 14.14 Distrib 5.6.10, for osx10.6 (x86_64) for a while with no issues. I had to hard restart my laptop tonight, and a while after it started, i tried to access a dev database. I got the following error:

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

以下是命令和响应:

$其中mysql
#=>mysql:别名为不正确的mysql

$ unset TMPDIR
$ mysql_install_db

#=>严重错误:找不到./bin/my_print_defaults

$ sudo /usr/local/mysql/support-files/mysql.server start

#=>错误!服务器退出而不更新PID文件(/usr/local/mysql/whoamis-MacBook-Pro.local.pid).

$ mysqld

#=> 2013-10-19 00:11:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-10-19 00:11:08 5029 [Warning] Can't create test file /usr/local/var/mysql/whoamis-MacBook-Pro.lower-test
2013-10-19 00:11:08 5029 [Warning] Can't create test file /usr/local/var/mysql/whoamis-MacBook-Pro.lower-test
mysqld: Can't change dir to '/usr/local/var/mysql/' (Errcode: 2 - No such file or directory)
2013-10-19 00:11:08 5029 [ERROR] Aborting

2013-10-19 00:11:08 5029 [Note] Binlog end
2013-10-19 00:11:08 5029 [Note] mysqld: Shutdown complete

$ usr/local/Cellar/mysql

当然,这里也安装了mysql.因此,在/usr/local/mysql 中有一个,在/usr/local/Cellar/mysql 中有一个,但在/usr/local/中没有一个var ,至少是 mysqld 所寻找的地方.值得注意的是,系统偏好设置工具以及mySQL Workbench服务器工具也无法成功启动服务器.任何想法从这里开始吗?

sure enough, there was a mysql installation here, too. So there's one in /usr/local/mysql and there's one in /usr/local/Cellar/mysql, but there's not one in /usr/local/var which is where mysqld, at least, seems to be looking. It's worth noting that the system preferences tool as well as mySQL Workbench server tool doesn't successfully start the server, either. Any idea where to proceed from here?

推荐答案

按照有效!但是,请注意,这可能不是最佳"方法-正如布拉德·奎尔霍斯特(Brad Quellhorst)在评论中指出的那样:

It works! However, it's good to note that this isn't perhaps the 'best' way - as Brad Quellhorst notes in the comments:

更好的建议是删除最近添加到my.cnf的所有文件,并作为最后手段删除该文件",除非您已经有了默认的my.cnf,否则删除它会破坏 any配置选项支持默认设置,而默认设置则是非常不安全的.将MySQL绑定到所有开放的IP并删除任何缓存,复制和数据信息,这不是错字型配置语句的解决方案.

The better advice would be "Remove anything you recently added to my.cnf and remove the file as a last resort" Unless you already have a bare-defaults my.cnf, by removing it you're destroying any configuration options in favor of defaults, which among other things, are rather insecure. Binding MySQL to all open IPs and removing any caching, replication, and data information is not the solution to a typo'd configuration statement.

这篇关于在osx上两次安装mysql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆