使用Macports设置MySQL 5.6 [英] Setup MySQL 5.6 with Macports
问题描述
MacOS 10.10,最新的macport.我想在端口3306上获得mysql 5.6.
1)安装
port install mysql56-server mysql56
之后安装mysql56@5.6.22_0
which mysql
或
which mysql56
不返回任何内容.
所以第一个问题是mysql客户端在哪里?
2)配置
建议安装脚本
sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db
然后
/opt/local/lib/mysql56/bin/mysqladmin -u root password 'new-password'
询问正在运行的服务器,然后我启动
cd /opt/local ; /opt/local/lib/mysql56/bin/mysqld_safe &
然后 mysqladmin 抱怨套接字,我在/opt/local/etc/mysql56/macports-default.cnf 中注释了-skip-networking em>,然后该命令运行正常.然后
/opt/local/lib/mysql56/bin/mysqladmin -u root -h bp.local password 'new-password'
返回
error: 'Host '10.0.1.9' is not allowed to connect to this MySQL server'
如果没有mysql客户端,我真的不知道该怎么办.而且我有点卡住. 有什么建议吗?
MacPorts以不相互冲突的方式安装MySQL及其派生版本,并且可以同时安装它们.这包括将mysql二进制文件放在非标准路径中.您可以使用port contents mysql56 | grep -E '/s?bin/'
找到二进制文件. MacPorts还带有一个选择机制,可以在/opt/local/bin
中创建符号链接以便于您使用.要将MySQL 5.6设置为默认值,请运行sudo port select --set mysql mysql56
.
要启动服务器,可以使用MacPorts的守护程序控制功能(这是要启动的前端):sudo port load mysql56-server
将启动服务器并确保其在重新启动后运行,sudo port unload mysql56-server
将撤消该操作并停止该服务器.服务器.
--skip-networking
是默认设置,可以并行运行多个MySQL版本.有关更多信息,请参见port notes mysql56
.
您可以使用unix套接字连接到MacPorts的MySQL,尽管我从头顶上不记得它的路径.我确定 http://trac.macports.org/wiki/howto/MAMP 有他们,但是.要连接到本地服务器,应使用localhost
或127.0.0.1
而不是bp.local
,它们显然会解析为私有IP地址,因此通过操作系统的IP堆栈,而不是通过回送接口. /p>
MacOS 10.10, up-to-date macports. I want to get mysql 5.6 on port 3306.
1) Installing
port install mysql56-server mysql56
installs mysql56@5.6.22_0, after that
which mysql
or
which mysql56
returns nothing.
So first question is where is mysql client?
2) Configuring
Installation script suggests to do
sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db
then
/opt/local/lib/mysql56/bin/mysqladmin -u root password 'new-password'
which asks for running server and I start it by
cd /opt/local ; /opt/local/lib/mysql56/bin/mysqld_safe &
then mysqladmin complains about socket and I comment --skip-networking in /opt/local/etc/mysql56/macports-default.cnf and after that command goes ok. then
/opt/local/lib/mysql56/bin/mysqladmin -u root -h bp.local password 'new-password'
which returns
error: 'Host '10.0.1.9' is not allowed to connect to this MySQL server'
I really don't know what to do here without mysql client. And I'm kind of stuck. Any suggestions?
MacPorts installs MySQL and its derivatives in a way that they don't conflict with each other and can be installed at the same time. That includes putting the mysql binary in non-standard paths. You can locate your binary using port contents mysql56 | grep -E '/s?bin/'
. MacPorts also comes with a selection mechanism that creates symlinks for your convenience in /opt/local/bin
. To make MySQL 5.6 your default, run sudo port select --set mysql mysql56
.
To start the server, you can use MacPorts' daemon control functions (that are a frontend to launchd): sudo port load mysql56-server
will start the server and ensure it is running after a reboot, sudo port unload mysql56-server
will undo that and stop the server.
The --skip-networking
is the default to make running multiple MySQL versions side-by-side possible. See port notes mysql56
for more information.
You can connect to MacPorts' MySQL using a unix socket, although I don't recall its path from the top of my head. I'm sure http://trac.macports.org/wiki/howto/MAMP has them, though. To connect to your local server, you should use localhost
or 127.0.0.1
instead of bp.local
, which apparently resolves to a private IP address and thus goes through the IP stack of your OS, rather than through the loopback interface.
这篇关于使用Macports设置MySQL 5.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!