Mac上安装mariadb

1、查看mariadb包信息

# brew info mariadb

mariadb: stable 10.2.6 (bottled)
Drop-in replacement for MySQL
https://mariadb.org/
Conflicts with: mariadb-connector-c, mysql, mysql-cluster, mysql-connector-c, mytop, percona-server
/usr/local/Cellar/mariadb/10.1.23 (594 files, 155.5MB) *
  Poured from bottle on 2017-05-14 at 17:49:24
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mariadb.rb
==> Dependencies
Build: cmake ✔
Required: openssl ✔
==> Options
--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
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

MySQL is configured to only allow connections from localhost by default

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

2、安装mariadb

# brew install mariadb

3、运行Installer

# unset TMPDIR
# cd /usr/local/Cellar/mariadb/10.1.23/
# mysql_install_db

4、启动服务(包信息中有说明如何启动)

后台启动,并且开机自启动
# brew services start mariadb
==> Tapping homebrew/services
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 10 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (10/10), done.
Tapped 0 formulae (37 files, 51.1KB)
==> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)

前台启动
# mysql.server start
Starting MySQL
.170529 21:36:17 mysqld_safe Logging to '/usr/local/var/mysql/bogon.err'.
170529 21:36:17 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
 SUCCESS!

5、Secure the Installation

# mysql_secure_installation

6、查看版本

# mysql -uroot -p
MariaDB [(none)]> select @@version;
+-----------------+
| @@version       |
+-----------------+
| 10.1.23-MariaDB |
+-----------------+
1 row in set (0.00 sec)

转载于:https://www.cnblogs.com/keithtt/p/6919168.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值