Installing MariaDB 10.0.10 on Mac OS X with Homebrew

Apple OS
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Installing MariaDB 10.0.10 on Mac OS X with Homebrew

文章 yehlu »

https://mariadb.com/blog/installing-mar ... x-homebrew


MariaDB
Products
Services
Solutions
Customers
Resources
News & Events
About

Blog|LoginSign Up
You are here
Home » Blogs » benstillman's blog
Installing MariaDB 10.0.10 on Mac OS X with Homebrew

WED, 2014-04-30 12:54
BENSTILLMAN
Developing on your Mac? Get the latest stable MariaDB version set up on OS X easily with Homebrew. See this step by step guide on installing MariaDB 10.0.10 by Ben Stillman.

If you do already have Xcode and Homebrew installed, skip to step 4.

1 Install Xcode
xcode-select --install

bens-mbp:~ ben$ xcode-select --install
xcode-select: note: install requested for command line developer tools
2 Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

bens-mbp:~ ben$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1

==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
Press RETURN to continue or any other key to abort
bens-mbp:~ ben$ xcode-select --install
xcode-select: note: install requested for command line developer tools
bens-mbp:~ ben$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/share /usr/local/share/man
/usr/local/share/man/man1
Password:
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/share /usr/local/share/man
/usr/local/share/man/man1
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 166564, done.
remote: Compressing objects: 100% (46782/46782), done.
remote: Total 166564 (delta 118679), reused 166545 (delta 118666)
Receiving objects: 100% (166564/166564), 31.57 MiB | 8.56 MiB/s, done.
Resolving deltas: 100% (118679/118679), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at a5e73d4 datomic 0.9.4718
==> Installation successful!
You should run `brew doctor' *before* you install anything.
Now type: brew help
3 Check Homebrew
brew doctor

bens-mbp:~ ben$ brew doctor
Your system is ready to brew.
4 Update Homebrew
brew update

bens-mbp:~ ben$ brew update
Already up-to-date.
5 Verify MariaDB Version in Homebrew Repo
brew info mariadb

bens-mbp:~ ben$ brew info mariadb
mariadb: stable 10.0.10 (bottled)
http://mariadb.org/
Conflicts with: mysql, mysql-cluster, mysql-connector-c, percona-server
Not installed
From: https://github.com/Homebrew/homebrew/co ... mariadb.rb
==> Dependencies
Build: cmake ✘
==> Options
--enable-local-infile
Build with local infile loading support
--universal
Build a universal binary
--with-archive-storage-engine
Compile with the ARCHIVE storage engine enabled
--with-bench
Keep benchmark app when installing
--with-blackhole-storage-engine
Compile with the BLACKHOLE storage engine enabled
--with-embedded
Build the embedded server
--with-libedit
Compile with editline wrapper instead of readline
--with-tests
Keep test when installing
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To have launchd start mariadb at login:
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
Then to load mariadb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
6 Install MariaDB
brew install mariadb

bens-mbp:~ ben$ brew install mariadb
==> Downloading https://downloads.sf.net/project/machom ... s/mariadb-
10.0.10.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mariadb-10.0.10.mavericks.bottle.tar.gz
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To have launchd start mariadb at login:
ln -sfv /usr/local/opt/mariadb/*.plist ~/Library/LaunchAgents
Then to load mariadb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> /usr/local/Cellar/mariadb/10.0.10/bin/mysql_install_db --verbose --user=ben
--basedir=/usr/local/Cellar/mariadb/10.0.10 --datadir=/usr/local/va
==> Summary
/usr/local/Cellar/mariadb/10.0.10: 524 files, 125M
7 Run the Database Installer
unset TMPDIR
cd /usr/local/Cellar/mariadb/10.0.10/
mysql_install_db

bens-mbp:~ ben$ unset TMPDIR
bens-mbp:~ ben$ cd /usr/local/Cellar/mariadb/10.0.10/
bens-mbp:10.0.10 ben$ mysql_install_db
Installing MariaDB/MySQL system tables in './data' ...
140416 12:00:59 [Note] InnoDB: The InnoDB memory heap is disabled
140416 12:00:59 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
140416 12:00:59 [Note] InnoDB: Compressed tables use zlib 1.2.5
140416 12:00:59 [Note] InnoDB: Using CPU crc32 instructions
140416 12:00:59 [Note] InnoDB: Initializing buffer pool, size = 128.0M
140416 12:00:59 [Note] InnoDB: Completed initialization of buffer pool
140416 12:00:59 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to
be created!
140416 12:00:59 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
140416 12:00:59 [Note] InnoDB: Database physically writes the file full: wait...
140416 12:00:59 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
140416 12:00:59 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
140416 12:00:59 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
140416 12:00:59 [Warning] InnoDB: New log files created, LSN=45781
140416 12:00:59 [Note] InnoDB: Doublewrite buffer not found: creating new
140416 12:00:59 [Note] InnoDB: Doublewrite buffer created
140416 12:00:59 [Note] InnoDB: 128 rollback segment(s) are active.
140416 12:00:59 [Warning] InnoDB: Creating foreign key constraint system tables.
140416 12:00:59 [Note] InnoDB: Foreign key constraint system tables created
140416 12:00:59 [Note] InnoDB: Creating tablespace and datafile system tables.
140416 12:00:59 [Note] InnoDB: Tablespace and datafile system tables created.

140416 12:00:59 [Note] InnoDB: Waiting for purge to start
140416 12:00:59 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.15-63.0 started; log sequence
number 0
140416 12:01:00 [Note] InnoDB: FTS optimize thread exiting.
140416 12:01:00 [Note] InnoDB: Starting shutdown...
140416 12:01:01 [Note] InnoDB: Shutdown completed; log sequence number 1619048
OK
Filling help tables...
140416 12:01:01 [Note] InnoDB: The InnoDB memory heap is disabled
140416 12:01:01 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
140416 12:01:01 [Note] InnoDB: Compressed tables use zlib 1.2.5
140416 12:01:01 [Note] InnoDB: Using CPU crc32 instructions
140416 12:01:01 [Note] InnoDB: Initializing buffer pool, size = 128.0M
140416 12:01:01 [Note] InnoDB: Completed initialization of buffer pool
140416 12:01:01 [Note] InnoDB: Highest supported file format is Barracuda.
140416 12:01:01 [Note] InnoDB: 128 rollback segment(s) are active.
140416 12:01:01 [Note] InnoDB: Waiting for purge to start
140416 12:01:01 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.15-63.0 started; log sequence
number 1619048
140416 12:01:01 [Note] InnoDB: FTS optimize thread exiting.
140416 12:01:01 [Note] InnoDB: Starting shutdown...
140416 12:01:02 [Note] InnoDB: Shutdown completed; log sequence number 1619058
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:

'./bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h bens-mbp.roving.com password 'new-password'

Alternatively you can run:
'./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 Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='./data'

You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
SkySQL Ab. You can contact us about this at sales@skysql.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-t ... b-project/
8 Start MariaDB
mysql.server start

bens-mbp:10.0.10 ben$ mysql.server start
Starting MySQL
. SUCCESS!
9 Secure the Installation
mysql_secure_installation

bens-mbp:10.0.10 ben$ mysql_secure_installation
/usr/local/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
10 Connect to MariaDB
mysql -u root -p

bens-mbp:10.0.10 ben$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.0.10-MariaDB Homebrew

Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
11 Verify MariaDB Version
select @@version;

MariaDB [(none)]> select @@version;
+-----------------+
| @@version |
+-----------------+
| 10.0.10-MariaDB |
+-----------------+
1 row in set (0.00 sec)
Tags: DBA
About the Author
benstillman's picture
Ben Stillman is a Senior Consultant working with MariaDB and MySQL.


manav_misra_g
Oct 4 2014
Great Detail, Great Tutorial
I followed a similar guide and had some trouble, but following on here made it a snap. I felt confident that I was proceeding properly by corresponding my output with the detailed output in the guide.
Log in or register to post comments

susan_perkins_g
Oct 8 2014
update hombrew url
Hi, Thanks for the tutorial! Went to install Homebrew as per your instructions and it said to update the install url to ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)" Also said to ask the person who posted it to update it in their post. So that's what I'm doing.
Log in or register to post comments

gustavoneves
Oct 20 2014
Just FYI
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Whoops, the Homebrew installer has moved! Please instead run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)" Also, please ask wherever you got this link from to update it to the above. Thanks!
Log in or register to post comments

said_assemlal_g
Dec 18 2014
just work
Hello, i have OS X 10.10 and it's work. Thanks
Log in or register to post comments

victoria_mielke_g
Jan 16 2015
Accessed denied issue
My MariaDB v.14 stopped working on Yosemite a couple days ago. I uninstalled, completely removed all MySQL/MariaDB from machine. I then reinstalled v15 via Homebrew. I tried to follow steps here but keep getting ERROR access denied for root@localhost[using password=TRUE]. I just can't find any solution to this anywhere! I don't have a my.cnf file anymore and can't find one that works well.
Log in or register to post comments

v4sk_g
Feb 8 2015
It works great
Thanks Ben it worked great.
Log in or register to post comments

ken_robinson_g
5:53 May 18
Awesome-Sauce
Great tutorial. Everything I needed even when I didn't know I needed it!!
Log in or register to post comments
Login or register to post comments

Are YOU evaluating database software?
See how MariaDB compares to other database platforms ›

Related Blogs
Protect Your Data: Row-level Security in MariaDB 10.0
Optimizing Out-of-order Parallel Replication with MariaDB 10.0
Configuring PAM Authentication and User Mapping with MariaDB
DevOps with MariaDB and Ansible, Part 2
MariaDB Galera Cluster: A Quirk of Bootstrapping
Improving your MariaDB Back-Up Plan
Team MariaDB looking forward to Percona Live MySQL Conference and Expo
MariaDB DevOps: Installing MariaDB with SaltStack
Streaming MariaDB backups in the cloud
Advanced MariaDB monitoring with Nagios
By This Author
How I Converted My Invision Power Board Site from MySQL 5.1 to MariaDB 10 With Minimal Downtime
Upgrading MySQL 5.1 to MariaDB 10.0 on CentOS 6
Setup MariaDB Enterprise Cluster, part 3: Setup HA Proxy Load Balancer with Read and Write Pools
Setting Up a MariaDB Enterprise Cluster, Part 2: How to Set Up a MariaDB Cluster
Setting Up a MariaDB Enterprise Cluster, Part 1: How to Set Up a Virtual Machine Template
Blog Archive

Subscribe to get MariaDB tips, tricks and news updates in your inbox:

Email *
Products
MariaDB Enterprise
MariaDB Enterprise Cluster
MariaDB MaxScale
MariaDB 10
MariaDB on IBM POWER8
InfiniDB
Connectors & Plugins
Embedded for OEMs & ISVs
Product Comparison
Product FAQs
Services
Services Overview
Support
Remote DBA
Consulting
Training
Custom Development Services & NRE
InfiniDB Services
Services FAQs
Solutions
High Availability
CustomersResources
Downloads
Blog
Knowledge Base
Guides & Whitepapers
Technical Presentations
Community Tools
MariaDB.org
MariaDB Books
Report a Bug
24x7 Emergency Support
MariaDB Portal
News & Events
Press Releases
Webinars
Events
In the News
Newsletters
About
Leadership
Investors
Partners
Careers
Legal
Contact
Need a truly enterprise-grade and open source database solution that's application-compatible with MySQL?

Try MariaDB Enterprise
© Copyright 2015 MariaDB Corporation Ab. MariaDB is a trademark or registered trademarks of MariaDB Corporation Ab in the European Union and United States of America and/or other countries. This website is proud to run on MariaDB. MySQL is a trademark of Oracle Corporation Inc. Trademarks Statement | Privacy Policy
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

How do I start MariaDB on boot on Mac OS X?

文章 yehlu »

http://stackoverflow.com/questions/1746 ... n-mac-os-x

代碼: 選擇全部

cp /usr/local/Cellar/mariadb/10.0.19/homebrew.mxcl.mariadb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Installing MariaDB 10.0.10 on Mac OS X with Homebrew

文章 yehlu »

代碼: 選擇全部


551-MacBook-Pro:~ dorado$ brew install mariadb
==> Installing dependencies for mariadb: openssl
==> Installing mariadb dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2g.el_capitan.b
######################################################################## 100.0%
==> Pouring openssl-1.0.2g.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

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 to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
  /usr/local/Cellar/openssl/1.0.2g: 1,678 files, 12.0M
==> Installing mariadb
==> Downloading https://homebrew.bintray.com/bottles/mariadb-10.1.13.el_capitan.
######################################################################## 100.0%
==> Pouring mariadb-10.1.13.el_capitan.bottle.tar.gz
==> /usr/local/Cellar/mariadb/10.1.13/bin/mysql_install_db --verbose --user=dora
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
    mysql -uroot

To have launchd start mariadb now and restart at login:
  brew services start mariadb
Or, if you don't want/need a background service you can just run:
  mysql.server start
==> Summary
  /usr/local/Cellar/mariadb/10.1.13: 572 files, 131M

yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Installing MariaDB 10.0.10 on Mac OS X with Homebrew

文章 yehlu »

my.cnf

代碼: 選擇全部

/usr/local/etc/my.cnf

datadir

代碼: 選擇全部

 /usr/local/var/mysql/
start

代碼: 選擇全部

brew services start mariadb
stop

代碼: 選擇全部

 brew services stop mariadb
list

代碼: 選擇全部

brew services list
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Installing MariaDB 10.0.10 on Mac OS X with Homebrew

文章 yehlu »

https://mariadb.com/blog/installing-mar ... x-homebrew

Developing on your Mac? Get the latest stable MariaDB version set up on OS X easily with Homebrew. See this step by step guide on installing MariaDB 10.1.16.


1 Install Xcode
xcode-select --install

bens-mbp:~ ben$ xcode-select --install
xcode-select: note: install requested for command line developer tools

2 Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)"

Bens-MacBook-Pro:~ ben$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /Users/ben/Library/Caches/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /Users/ben/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown ben /Users/ben/Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 537, done.
remote: Compressing objects: 100% (478/478), done.
remote: Total 537 (delta 31), reused 341 (delta 28), pack-reused 0
Receiving objects: 100% (537/537), 817.70 KiB | 1.25 MiB/s, done.
Resolving deltas: 100% (31/31), done.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
HEAD is now at 984ed83 doctor: print check on --debug.
==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3716, done.
remote: Compressing objects: 100% (3603/3603), done.
remote: Total 3716 (delta 15), reused 1863 (delta 4), pack-reused 0
Receiving objects: 100% (3716/3716), 2.88 MiB | 3.74 MiB/s, done.
Resolving deltas: 100% (15/15), done.
Checking connectivity... done.
Tapped 3594 formulae (3,743 files, 8.9M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics

3 Check Homebrew
brew doctor

bens-mbp:~ ben$ brew doctor
Your system is ready to brew.

4 Update Homebrew
brew update

bens-mbp:~ ben$ brew update
Already up-to-date.

5 Verify MariaDB Version in Homebrew Repo
brew info mariadb

Bens-MacBook-Pro:~ ben$ brew info mariadb
mariadb: stable 10.1.16 (bottled), devel 10.2.1
Drop-in replacement for MySQL
https://mariadb.org/
Conflicts with: mariadb-connector-c, mysql, mysql-cluster, mysql-connector-c, mytop, percona-server
Not installed
From: https://github.com/Homebrew/homebrew-co ... mariadb.rb
==> Dependencies
Build: cmake ✘
Required: openssl ✘
==> Options
--universal
Build a universal binary
--with-archive-storage-engine
Compile with the ARCHIVE storage engine enabled
--with-bench
Keep benchmark app when installing
--with-blackhole-storage-engine
Compile with the BLACKHOLE storage engine enabled
--with-embedded
Build the embedded server
--with-libedit
Compile with editline wrapper instead of readline
--with-local-infile
Build with local infile loading support
--with-test
Keep test when installing
--devel
Install development version 10.2.1
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To have launchd start mariadb now and restart at login:
brew services start mariadb
Or, if you don't want/need a background service you can just run:
mysql.server start

6 Install MariaDB
brew install mariadb

Bens-MacBook-Pro:~ ben$ brew install mariadb
==> Installing dependencies for mariadb: openssl
==> Installing mariadb dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/op ... tle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

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 to your
build variables:

LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
/usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12M
==> Installing mariadb
==> Downloading https://homebrew.bintray.com/bottles/ma ... tle.tar.gz
######################################################################## 100.0%
==> Pouring mariadb-10.1.16.el_capitan.bottle.tar.gz
==> /usr/local/Cellar/mariadb/10.1.16/bin/mysql_install_db --verbose --user=ben --basedir=/usr/local/Cellar/mariadb/10.1.16 --datadir=/usr/local/var/mysql --tmpdir=/tmp
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To have launchd start mariadb now and restart at login:
brew services start mariadb
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
/usr/local/Cellar/mariadb/10.1.16: 573 files, 137.1M

7 Run the Database Installer
mysql_install_db

Bens-MacBook-Pro:10.1.16 ben$ mysql_install_db
Installing MariaDB/MySQL system tables in '/usr/local/var/mysql' ...
2016-08-16 19:15:02 140735320776704 [Note] /usr/local/Cellar/mariadb/10.1.16/bin/mysqld (mysqld 10.1.16-MariaDB) starting as process 83824 ...
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Memory barrier is not used
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Compressed tables use zlib 1.2.5
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Using SSE crc32 instructions
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Completed initialization of buffer pool
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Waiting for purge to start
2016-08-16 19:15:02 140735320776704 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616819
2016-08-16 19:15:02 123145313034240 [Note] InnoDB: Dumping buffer pool(s) not yet started
OK
Filling help tables...
2016-08-16 19:15:04 140735320776704 [Note] /usr/local/Cellar/mariadb/10.1.16/bin/mysqld (mysqld 10.1.16-MariaDB) starting as process 83828 ...
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Memory barrier is not used
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Compressed tables use zlib 1.2.5
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Using SSE crc32 instructions
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Completed initialization of buffer pool
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Waiting for purge to start
2016-08-16 19:15:04 140735320776704 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616829
2016-08-16 19:15:04 123145313034240 [Note] InnoDB: Dumping buffer pool(s) not yet started
OK
Creating OpenGIS required SP-s...
2016-08-16 19:15:07 140735320776704 [Note] /usr/local/Cellar/mariadb/10.1.16/bin/mysqld (mysqld 10.1.16-MariaDB) starting as process 83833 ...
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Memory barrier is not used
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Compressed tables use zlib 1.2.5
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Using SSE crc32 instructions
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Completed initialization of buffer pool
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Waiting for purge to start
2016-08-16 19:15:07 140735320776704 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616839
2016-08-16 19:15:07 123145313034240 [Note] InnoDB: Dumping buffer pool(s) not yet started
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/10.1.16/bin/mysqladmin' -u root password 'new-password'
'/usr/local/Cellar/mariadb/10.1.16/bin/mysqladmin' -u root -h Bens-MacBook-Pro.local password 'new-password'

Alternatively you can run:
'/usr/local/Cellar/mariadb/10.1.16/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 Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr/local/Cellar/mariadb/10.1.16' ; /usr/local/Cellar/mariadb/10.1.16/bin/mysqld_safe --datadir='/usr/local/var/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/Cellar/mariadb/10.1.16/mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-t ... b-project/

8 Start MariaDB
mysql.server start

Bens-MacBook-Pro:10.1.16 ben$ mysql.server start
Starting MySQL
. SUCCESS!

9 Secure the Installation
mysql_secure_installation

Bens-MacBook-Pro:10.1.16 ben$ mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

10 Connect to MariaDB
mysql -u root -p

Bens-MacBook-Pro:10.1.16 ben$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.1.16-MariaDB Homebrew

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: Installing MariaDB 10.0.10 on Mac OS X with Homebrew

文章 yehlu »

代碼: 選擇全部

/usr/local/etc/my.cnf
mysql.server stop
mysql.server start

代碼: 選擇全部

brew services start mariadb
回覆文章

回到「Mac OS X」