在Mac上为mysql更改端口号 [英] Change port # for mysql on mac
问题描述
我刚刚在运行10.6的Mac上安装了mysql. mysql版本是5.1.56.我需要在端口3307上运行mysql.本文说,我们可以通过修改此文件来更改端口:
I just installed mysql on a mac running 10.6. The mysql version is 5.1.56. I need to have mysql run on port 3307. This article says we can change the port by modifying this file:
# vi /etc/my.cnf
http://www.cyberciti.biz/faq /change-default-mysql-port-under-linuxunix/
,但是/etc中没有这样的文件.我可以看到mysql运行正常,因为我可以很好地连接到它,我们现在更改端口#的方式是否有所不同?
but there is no such file in /etc. I can see mysql is running ok because I can connect to it just fine, is the way we change the port # different now?
谢谢
推荐答案
在OSX上,您可以创建/etc/my.cnf
(如果不存在).您可以基于/usr/local/mysql/support-files
中的示例.不要忘记重启MySQL,以使my.cnf
生效.
On OSX you can create /etc/my.cnf
if it does not exist. You can base it on samples found in /usr/local/mysql/support-files
. Don't forget to restart MySQL for your my.cnf
to take effect.
这篇关于在Mac上为mysql更改端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!