https://kb.askmonty.org/en/building-mariadb-on-mac-os-x-using-homebrew/

Work has been done to provide MariaDB via the Homebrewpackage manager, which has been described as the missing package manager for Mac OS X. Once you have installed Homebrew (with the command line brew), all you have to do is:

brew update

Compiling MariaDB

You can then run searches (brew search mariadb) , and if you would like to get more information about it, you could do: brew info mariadb. When you're ready to install MariaDB, simply execute:

brew install mariadb

As of MariaDB 5.2.6, it will pull in readline, and the output will be similar to below:

lovegood:~ byte$ brew install mariadb
Warning: It appears you have Macports or Fink installed
Software installed with other package managers causes known problems for
Homebrew. If formula fail to build uninstall Macports/Fink and reinstall any
affected formula.
Also installing dependencies: readline
==> Downloading ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file vi_mode.c
patching file callback.c
==> ./configure --prefix=/usr/local/Cellar/readline/6.2.1 --mandir=/usr/local/Ce
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /usr/local. OS X provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only. Generally there are no consequences of this for you.
If you build your own software and it requires this formula, you'll need
to add its lib & include paths to your build variables: LDFLAGS: -L/usr/local/Cellar/readline/6.2.1/lib
CPPFLAGS: -I/usr/local/Cellar/readline/6.2.1/include
==> Summary
/usr/local/Cellar/readline/6.2.1: 32 files, 2.1M, built in 31 seconds
==> Downloading http://ftp.osuosl.org/pub/mariadb/mariadb-5.2.6/kvm-tarbake-jaun
######################################################################## 100.0%
==> ./configure --without-docs --without-debug --disable-dependency-tracking --p
==> make install
==> Caveats
Set up databases with:
unset TMPDIR
mysql_install_db If this is your first install, automatically load on login with:
cp /usr/local/Cellar/mariadb/5.2.6/com.mysql.mysqld.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist If this is an upgrade and you already have the com.mysql.mysqld.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
cp /usr/local/Cellar/mariadb/5.2.6/com.mysql.mysqld.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist Note on upgrading:
We overwrite any existing com.mysql.mysqld.plist in ~/Library/LaunchAgents
if we are upgrading because previous versions of this brew created the
plist with a version specific program argument. Or start manually with:
mysql.server start
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/mariadb/5.2.6: 231 files, 44M, built in 10.9 minutes
lovegood:~ byte$

Installing MariaDB

Once that is complete, you need to do the following:

unset TMPDIR
mysql_install_db

When you run mysql_install_db, you will see the following output:

lovegood:~ byte$ mysql_install_db
Installing MariaDB/MySQL system tables in '/usr/local/var/mysql' ...
OK
Filling help tables...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands: /usr/local/Cellar/mariadb/5.2.6/bin/mysqladmin -u root password 'new-password'
/usr/local/Cellar/mariadb/5.2.6/bin/mysqladmin -u root -h lovegood.local password 'new-password' Alternatively you can run:
/usr/local/Cellar/mariadb/5.2.6/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the MariaDB knowledge or the MySQL manual for more instructions. You can start the MariaDB daemon with:
cd /usr/local/Cellar/mariadb/5.2.6 ; /usr/local/Cellar/mariadb/5.2.6/bin/mysqld_safe --datadir=/usr/local/var/mysql You can test the MariaDB daemon with mysql-test-run.pl
cd /usr/local/Cellar/mariadb/5.2.6/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/local/Cellar/mariadb/5.2.6/bin/mysqlbug script! The latest information about MariaDB is available at http://www.askmonty.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
Monty Program Ab. You can contact us about this at sales@askmonty.org.
Alternatively consider joining our community based development effort:
http://askmonty.org/wiki/index.php/MariaDB#How_can_I_participate_in_the_development_of_MariaDB lovegood:~ byte$

Starting MariaDB

Once that is complete, and if you are running this in a production instance, please remember to run mysql_secure_installation. If you're just testing it, follow the instructions to start it out:

lovegood:~ byte$ cd /usr/local/Cellar/mariadb/5.2.6 ; /usr/local/Cellar/mariadb/5.2.6/bin/mysqld_safe --datadir=/usr/local/var/mysql
110614 20:27:38 mysqld_safe Logging to '/usr/local/var/mysql/lovegood.local.err'.
chown: /usr/local/var/mysql/lovegood.local.err: Operation not permitted
110614 20:27:38 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql

And that's done! Now you can just run mysql -uroot and login.

Using MariaDB

lovegood:~ byte$ mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.2.6-MariaDB Source distribution This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> SELECT VERSION();
+---------------+
| VERSION() |
+---------------+
| 5.2.6-MariaDB |
+---------------+
1 row in set (0.00 sec) MariaDB [(none)]>

Upgrading MariaDB

First you need to update your brew installation. You do this by issuing the brew update command. Next you simply run:

brew upgrade mariadb

You may see error messages as follows if you are running OS X 10.7:

Warning: Your Xcode (4.3.3) is outdated
Please install Xcode 4.5.2.

You can safely ignore these errors and upgrade to 5.5.28 without issue.

Known Issues

Currently (5.3 series), the default compile has some engines that are missing. This is noted via:

MariaDB [(none)]> SHOW ENGINES;
+------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |
| InnoDB | YES | XtraDB engine based on InnoDB plugin. Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| CSV | YES | CSV storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
+------------+---------+--------------------------------------------------------------------------------------------------+--------------+------+------------+
5 rows in set (0.00 sec) MariaDB [(none)]>

Why are there no binaries for Mac on the download page

MariaDB is an open source project and to be able to provide binaries for a platform we need someone to:

  • Provide a Mac OSX buildbot slave where we can do the builds.
  • Help us creating proper Mac OSX packages.
  • Sponsor us with a Mac OSX machine for the builds.

Other resources

Login or signup to receive notifications when this page changes.

Comments

Include Archived 
Flag as Spam/Inappropriate 1 month, 1 week ago franperr

Hi, I followed this tutorial and MariaDB works like a charm under Mac OSX Lion, but I can not start it automatically. I think it can related to the fact that my datadir is not the default one, so I have to pass arguments to the plist file. Any idea how can I do it ?

(转)Building MariaDB on Mac OS X using Homebrew的更多相关文章

  1. MAC OS系统替换homebrew使用阿里云的镜像源

    MAC OS系统替换homebrew使用阿里云的镜像源 2019-03-03 15:13:42 南通SEO 阅读数 2024更多 分类专栏: 解决方案   MAC OS系统替换homebrew使用阿里 ...

  2. Install wget in Mac OS X Without Homebrew or MacPorts

    May 22, 2012 - 31 Comments The command line tool wget lets you retrieve a group of files from FTP an ...

  3. Mac OS X系统 HomeBrew的安装和简单使用

    1. 前言 作为linux系统的忠实粉丝,我们都很喜欢 (Debian/Ubuntu)系列的apt包管理系统和(Redhat/Fedora)系列的yum包管理系统. 包括Windows用户都有多种方便 ...

  4. 解决“Xlib.h not found when building graphviz on Mac OS X 10.8”错误

    After installing XQuartz you may add a symlink to your X11 installation folder by just entering (安装X ...

  5. Mac OS X下HomeBrew安装卸载

    1.卸载 cd `brew --prefix` rm -rf Cellar brew prune rm `git ls-files` rm -r Library/Homebrew Library/Al ...

  6. MAC OS系统替换homebrew使用阿里云或中科大的镜像源

    阿里云镜像 # 替换brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.aliyun.c ...

  7. mac OS 安装 Subversion JavaHL 客户端

    JavaHL原来官网  http://subclipse.tigris.org/wiki/JavaHL 目前已经全部转移到github 官方说明很详细 https://github.com/subcl ...

  8. 让 ASP.NET vNext 在 Mac OS 中飞呀飞。。。

    写在前面 阅读目录: 娓娓道来 Install ASP.NET vNext Command Line Tools 安装 Homebrew 使用 Homebrew,安装 KVM Install Subl ...

  9. Mac OS X 背后的故事

    Mac OS X 背后的故事 作者: 王越  来源: <程序员>  发布时间: 2013-01-22 10:55  阅读: 25840 次  推荐: 49   原文链接   [收藏]   ...

随机推荐

  1. C++ lambda 表达式传递的变量默认不可变

    我遇到例如以下问题: int count=0; listener->onTouchMoved=[count](Touch* t,Event* e){ count++; log("onT ...

  2. SqlServer 笔记

    问题一:这标红色的符号 取掉 一直没有见过标红色的符号,尝试把这些符号粘贴出来到 notepad 发现它是乱码,尝试将它粘贴到sql查询分析器里,发现它显示空白.对于这种数据,一直想着找到这个acsi ...

  3. bootstrap前端开发框架,未来发展趋势

    http://v3.bootcss.com/getting-started/Bootstrap 起步 CSS 组件 JavaScript插件 定制 关于 CSS 设置全局CSS样式,基本的HTML元素 ...

  4. JavaScript经典魔力代码

    是什么使得JavaScript不同于其他程序设计语言,在浏览器修饰方面表现出其优异的特性?毫无疑问,JavaScript在Web应用领域受到的好评,既源于它自身灵活的动态特性,也源于浏览器对它充分的支 ...

  5. hexo博客的优化与配置——加入统计代码

    今天看着csdn博客的訪客数,就想给hexo博客也加入统计訪客的插件,上次折腾了个pacman主题,中间自带的是goole的统计,easy被墙,所以就想换一个统计工具,看了好多人用的都是cnzz的站长 ...

  6. python模块基础之OS模块

    OS模块简单的来说它是一个Python的系统编程的操作模块,可以处理文件和目录这些我们日常手动需要做的操作. 可以查看OS模块的帮助文档: >>> import os #导入os模块 ...

  7. HTML基础总结<文本格式>

    HTML 文本格式化标签 标签 描述 <b> 定义粗体文本 <em> 呈现为被强调的文本 <i> 定义斜体字 <small> 定义小号字 <str ...

  8. input事件以及中文输入法的处理

    在项目的开发过程中,相信大家都处理过监听用户输入的事情,一般我们会用到onkeyup.onkeydown.onkeypress.onchange.oninput事件,虽然都很熟悉了,但是还是有必要巩固 ...

  9. Fragement理解

    ■ 初衷 可重用,碎片化UI,适应大屏幕pad和小屏幕手机 ■ 优点 自行控制加入,移除,交换. activity则由framework深度掌管. 切换流畅 模块化(逻辑上切割处理)   缺点带来额外 ...

  10. grunt之dev-pro环境切换

    在项目开发过程中和发布阶段需要在开发环境(dev)和生产环境(pro)之间切换,静态文件引用的切换等等. 使用grunt要如何解决上述问题,这里提供一个案列供参考. 用到的grunt插件: 文件合并: ...