- 浏览: 796929 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
aliang032:
文章很赞,有几个缺点:1、是你的服务端是单进程的,如果进程挂了 ...
php socket编程实例详解 -
最佳蜗牛:
最佳蜗牛 写道是不是缺少了一个toolbar.Realize( ...
wxPython写的简易编辑器(原创) -
最佳蜗牛:
是不是缺少了一个toolbar.Realize()?
wxPython写的简易编辑器(原创) -
最佳蜗牛:
2.7.3版本里不能显示工具栏的图标
wxPython写的简易编辑器(原创) -
sogo6:
我怎么安装的也不行? 裸奔啊。。。。。
让TextMate支持中文显示
Setting Up
I like to create a folder to contain the MySQL source code file and build folder. This way, I can later uninstall MySQL easily, as well as download and compile new versions, all in one place.
For these examples, we’ll create a folder called src in our home folder, and change directories into that folder. It will be our workspace for everything we do here:
cd ~/src
You’ll download and compile everything in this new folder.
Download, Extract, Etc.
Now we’re ready to start the real work. Just type (or cut-n-paste) each one of the following lines into Terminal, one by one. When one line finishes (some will take a while and dump a lot of information to the screen), enter the next one.
This will first download and then expand the MySQL source code distribution:
tar xzvf mysql-5.1.31.tar.gz
cd mysql-5.1.31
You then need to configure MySQL:
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \
-fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql \
--with-extra-charsets=complex --enable-thread-safe-client \
--enable-local-infile --enable-shared --with-plugins=innobase
When that process completes, you can initiate the actual compilation process:
This part can take a while. Now is a good time to go and get yourself a tasty beverage.
The last part of the build process is where MySQL actually gets installed. You’ll be prompted for your password here, because this is where files actually get written to their actual locations:
Next, we need to setup the initial databases and privileges. You may be prompted for your password again:
sudo ./bin/mysql_install_db --user=mysql
sudo chown -R mysql ./var
That’s it, MySQL is installed. But you’re not done yet.
Auto-Starting MySQL
Now that the install is done, you need to have MySQL auto-start every time you start or reboot your Mac. The easiest way to do this is using launchd.
I’ve prepared a launchd plist file that will manage MySQL, starting it at boot and stopping it cleanly at shutdown. Create a file named com.mysql.mysqld.plist using the text-editor of your choice, and save it to your Desktop. Enter the following text into the file:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>Program</key>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>mysql</string>
<key>WorkingDirectory</key>
<string>/usr/local/mysql</string>
</dict>
</plist>
Now we need to move the file into place and set the permissions on it. You may be prompted for your password again:
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
With the file in place, the last step is to tell launchd to load and startup MySQL. You may be prompted for your password again:
If things go well, you won’t see anything special happen, but MySQL will have started up. You can verify this, again back in Terminal:
This will initiate MySQL’s command-line monitor. If everything went well, you should see something like this:
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
If you see that, that’s it, you’re done! Type exit to quit the MySQL monitor.
If you see something else, verify that your paths are set correctly and try the command again. If things still don’t work, it’s likely that something didn’t work and the compile didn’t finish. Try going through the steps once more and see if you can catch any error messages.
Starting and Stopping MySQL Manually
If you ever want to stop MySQL manually, use this command in Terminal, entering you password when prompted:
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
To start it manually, use this command in Terminal, entering you password when prompted:
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
A Note about Security
The easiest way to secure your MySQL installation without affecting the way you (or your applications) will need to communicate with it is to limit anything but local connections to your MySQL server. In other words, only you and the apps you run on your own Mac will be able to connect. You won’t need to enter passwords when interacting with MySQL locally, and won’t need to tweak the default database.yml files that Rails creates, for example.
We can limit access by creating (or editing) the /etc/my.cnf file. If you have TextMate installed, you can enter the following command to create (or edit) the file:
If you use BBEdit, you’d use this command:
The handy bit about using TextMate (or BBEdit) for this task is that it will handle authentication and setting permissions for you.
Enter the following text into the file save it and close it, authenticating as needed:
bind-address = 127.0.0.1
Thanks to my friend Mike Clark for this tip.
If limiting access isn’t enough for you, you can read about setting a root access password for MySQL in this article.
Baking-In the MySQL Bindings
You can gain some bigtime Rails-to-MySQL speed improvements by building the MySQL C bindings for Ruby.
If you have an Intel Mac, just run the following command (entering your password when prompted):
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
If you have a PPC Mac (I hear some still exist), you’d enter:
sudo env ARCHFLAGS="-arch ppc" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
You’ll see a prompt asking you which gem to install:
Select which gem to install for your platform (universal-darwin9.0)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
Pick the option closest to the top that ends in “(ruby)”. In the example above, we’d want to select option 3.
Uninstalling MySQL
In case you one day decide that you’d like to remove MySQL, it’s easy to do when building from source:
sudo make uninstall
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo rm /Library/LaunchDaemons/com.mysql.mysqld.plist
FAQ :
我安装成功调用:mysqld_safe启动时,报以下错误:
090312 15:57:14 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/webserver/mysql/var/ is case insensitive 090312 15:57:14 [ERROR] /usr/local/webserver/mysql/libexec/mysqld: unknown option '--skip-federated' 090312 15:57:14 [ERROR] Aborting
于是,我找到my.cnf, 注释了--skip-federated,就一切ok了。
#--skip-federated
发表评论
-
Web性能压力测试工具之Siege详解
2013-05-28 18:01 1621Siege是一款开源的压力测试工具,设计用于评估WEB应用在 ... -
Linux的IO性能监控工具iostat详解
2013-05-26 03:08 3050Linux系统出现了性能问题,一般我们可以通过top、ios ... -
linux,centos下解压tar,gz,bz2,tgz,zip
2013-03-23 19:55 3192今天从ix主机上打包了个zip文件,到linuxvps下总 ... -
Installing Phusion Passenger and nginx on Mac OS X
2013-03-08 18:04 1680I was trying to install Phusi ... -
ld: symbol(s) not found for architecture x86_64
2013-03-08 10:58 3795GraphicsMagic 有一个Nodejs的客户端: ... -
在Mac下安装GraphicsMagick
2013-01-31 23:11 1480GraphicsMagic 有一个Nodejs的客户端: ... -
Mac Lion 的textmate全屏设置
2011-08-31 09:53 1827You’ll need: TextMate Xcod ... -
Linux服务器下查看网络流量
2011-08-01 01:37 1978推荐Linux下检测网卡流量的两款软件,其一是:nload,另 ... -
linux下ps 命令详解
2011-08-01 00:48 3399linux上进程有5种状态: 1. 运行(正在运行或在运行队列 ... -
linux sysstat 工具详细说明(二)
2011-08-01 00:41 2334iostat iostat 的命令格式 iosta ... -
sysstat 工具详细说明(一)
2011-08-01 00:38 6619sysstat 工具 内容提要 了解 ... -
uptime查看linux负载及数值的意义
2011-07-31 23:56 1291uptime命令都会用,但是结果什么意思呢?一般来说只要每个C ... -
查看linux版本命令
2011-07-31 18:45 10581. 查看内核版本命令: 1) [root ... -
修改Linux系統的默認連接數
2011-07-29 01:39 24831、修改用戶進程可打 ... -
Linux iptables防攻擊使用
2011-07-29 01:36 1689虛擬主機服務商在運 ... -
提升Linux服務器的安全性能
2011-07-29 01:34 1203眾所周知,就安全性而言,Linux相對於Windows ... -
Linux hosts.allow与hosts.deny文件设置
2011-07-29 01:05 51572redhat as4常用应用之hosts.allow和ho ... -
linux禁止root通过SSH远程登录访问设置
2011-07-29 00:38 1197禁止ROOT通过SSH远程登录访问改/etc/ssh/sshd ... -
Linux安全策略:你能信任你的ps命令吗?
2011-07-27 23:54 1407找出rootkit的首 ... -
Linux系统Iptables防火墙
2011-07-27 23:44 908Linux 的内置firewall机制,是通过kernel中的 ...
相关推荐
2.4.1. General Notes on Installing MySQL on Mac OS X 2.4.2. Installing MySQL on Mac OS X Using Native Packages 2.4.3. Installing the MySQL Startup Item 2.4.4. Installing and Using the MySQL Preference...
### MySQL 5.7在Windows系统上的安装与配置教程 #### 概述 MySQL是由Oracle公司维护的一个开源的关系型数据库管理系统。它以其性能稳定、功能强大而被广泛应用于各种应用场景中。本文档主要介绍了如何在Windows...
Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....
It is known to work with Mac OS X versions 10.6.8 (Snow Leopard) through 10.14 (Mojave – see notes below), and has been tested on a wide variety of phones. Although you should be careful with all ...
installing and configuring MySQL on the Linux, Windows 2000, and Mac OS X operating systems; MySQL security; debugging and repairing MySQL databases and servers; MySQL performance tuning; and ...
MySQL是世界上最受欢迎的开源数据库...本教程的"Mysql Installing.pdf"文件应该包含了这些步骤的详细指南,对于初学者来说是一份宝贵的资源。通过跟随教程,您将能够顺利安装MySQL,并开始探索这个强大的数据库世界。
### MySQL安装与启动详解 #### 一、MySQL简介 MySQL是全球最受欢迎的开源数据库系统之一。尽管它功能强大,但其设置过程简单易懂。本文将详细介绍如何在不同平台上安装和启动MySQL,并介绍如何通过`mysql`客户端...
Install PHP & MySQL on Windows, Mac OS X, or Linux Gain a thorough understanding of PHP syntax Master database design principles Write robust, maintainable, best practice code Build a working content ...
Install PHP & MySQL on Windows, Mac OS X, or Linux Gain a thorough understanding of PHP syntax Master database design principles Write robust, maintainable, best practice code Build a working content ...
Currently (at mono version 4.2.4) this store remains empty after installing Mono on Mac OS X. Fiddler uses the certificates in this store to validate the certificates of the websites visited. So you ...
Error installing ODBC driver MySQL ODBC5.3 ANSI Driver,ODBC error 13:无法加载 MySQL ODBC5.3 ANSI Driver ODBC驱动程序的安装例程, 因为存在系统错误代码 126:找不到指定的模块。 解决方案:如果电脑是...
本篇将基于提供的文档摘要,深入解析安装Oracle RAC on AIX的关键步骤与注意事项,为读者提供一份详尽的操作指南。 ### 安装准备阶段 #### 1. 下载并解压安装介质 首先,需要从Oracle官方网站的edelivery服务下载...
Microsoft Windows 2000 Scripting Guide - Installing Software on a Remote Computer
MySQL Administrator支持在Windows、Linux和Mac OS X操作系统上运行。 #### 3.2. Installing Under Windows 在Windows环境下,有两种安装方式: - **使用Windows Installer**:下载安装程序后,双击运行,按照...
Installing Your Driver on Windows Millennium INF File Guide
在IT领域,将一款设备刷入不同的操作系统或定制ROM是一种常见的技术操作,它允许用户根据个人喜好和需求自定义手机的界面与功能。本篇内容将深入解析如何在魅族MX2上安装MIUI系统,这是一项对于Android发烧友而言极...
根据提供的文档信息,本文将详细解析安装 Oracle RAC (Real Application Clusters) 在 AIX 操作系统上的步骤、注意事项及关键技术点。 ### 安装前准备 #### 下载安装介质与补丁集 ... - 示例文件包括:`B24442-01_1...