让 MySQL 在 OSX 10.7 Lion 上运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6317614/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting MySQL working on OSX 10.7 Lion
提问by sdepold
I'm currently trying to get MySQL working on OSX 10.7 Lion. I tried the brew way:
我目前正在尝试让 MySQL 在 OSX 10.7 Lion 上运行。我尝试了酿造方式:
brew install mysql
-> cmake -> no problems
-> make -> no problems
-> make install -> no problems
-> done
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Installing MySQL system tables...
/usr/local/bin/mysql_install_db: line 428: 15397 Done { echo "use mysql;"; cat $create_system_tables $fill_system_tables; }
15398 Done(141) | eval "$filter_cmd_line"
15401 Segmentation fault: 11 | $mysqld_install_cmd_line > /dev/null
Installation of system tables failed! Examine the logs in
/usr/local/var/mysql for more information.
Did anyone get mysql to run on Lion?
有没有人让 mysql 在 Lion 上运行?
回答by Francois Deschenes
You can download a MySQL installer as a DMG file, complete with an installer, system preferences pane and a startup script directly from MySQL. Go to MySQL's community server download page, select Mac OS X as the platform and pick the DMG file.
您可以直接从 MySQL 下载 MySQL 安装程序作为 DMG 文件,包括安装程序、系统首选项窗格和启动脚本。转到MySQL 的社区服务器下载页面,选择 Mac OS X 作为平台并选择 DMG 文件。
You can skip the registration form (there a little link under the signup form) and you should be on your way.
您可以跳过注册表单(注册表单下方有一个小链接),您就可以开始了。
Once the file is downloaded, double-click on the DMG, launch the installer and complete the installation. After that, install the startup script using its installer and finally the preferences pane by double-clicking on it. I highly recommend choosing to install it for all users on the computer.
下载文件后,双击 DMG,启动安装程序并完成安装。之后,使用其安装程序安装启动脚本,最后双击首选项窗格。我强烈建议选择为计算机上的所有用户安装它。
You'll find this way much easier than compiling from source.
您会发现这种方式比从源代码编译要容易得多。
You should check out Sequel Proif you need a great OS X tool to manage your MySQL databases.
如果您需要一个出色的 OS X 工具来管理您的 MySQL 数据库,您应该查看Sequel Pro。
回答by marxy
A drop in replacement for mysql is mariadb. You can install with 'brew install mariadb'. It builds on Lion.
mysql 的替代品是mariadb。您可以使用“brew install mariadb”进行安装。它建立在 Lion 之上。
Existing mysql drivers and clients just work. I'm using it with python-mysql and django.
现有的 mysql 驱动程序和客户端可以正常工作。我将它与 python-mysql 和 django 一起使用。
It's even called mysql so you won't even know the difference.
它甚至被称为 mysql,所以你甚至不知道其中的区别。
回答by sdepold
Ha! Got it!
哈!知道了!
First... download mysql-5.6.2 here: http://dev.mysql.com/downloads/mirror.php?id=402349#mirrors... once finished, untar the file and do this:
首先...在此处下载 mysql-5.6.2:http: //dev.mysql.com/downloads/mirror.php?id=402349#mirrors ...一旦完成,解压文件并执行以下操作:
mv path/to/mysql-5.6.2-m5-osx10.6-x86_64 /usr/local/mysql
echo "PATH=$PATH:/usr/local/mysql/bin" >> ~/.profile
# open a new tab
cd /usr/local/mysql #this is essential!
./scripts/mysql_install_db
mysqld_safe &
mysql -uroot
works for me :)
对我有用:)
回答by A4J
You need to set up your path environment too, and it's also good practise to set a root password while you're at it. I've created a full step-by-step here: How to install MySQL on Lion (Mac OS X )
您还需要设置您的路径环境,并且在您使用时设置 root 密码也是一种很好的做法。我在这里创建了一个完整的分步指南:如何在 Lion (Mac OS X) 上安装 MySQL
回答by Archie
I had MySQL installed already, but after upgrading to Lion it would no longer start.
我已经安装了 MySQL,但升级到 Lion 后,它不再启动。
I tried installing the latest official version and it still wouldn't start.
我尝试安装最新的官方版本,但它仍然无法启动。
Finally, this fixed it:
最后,这修复了它:
$ sudo mkdir /var/log/mysql
$ sudo chown mysql:mysql /var/log/mysql
回答by Dan Bucholtz
All,
全部,
I was having issues with connecting to my DB through Tomcat, yet could through the MySql tool. Tomcat was accessing it through the actual IP of my machine (10.0.x.x) instead of through localhost or 127.0.0.1. Turns out that when I migrated from SL to Lion, remote connections were disabled. Once I enabled them, it worked fine.
我在通过 Tomcat 连接到我的数据库时遇到问题,但可以通过 MySql 工具。Tomcat 通过我机器的实际 IP (10.0.xx) 而不是通过 localhost 或 127.0.0.1 访问它。事实证明,当我从 SL 迁移到 Lion 时,远程连接被禁用。一旦我启用它们,它就可以正常工作。
Hopefully this helps someone.
希望这有助于某人。