# MariaDB

## Install

```
brew install mariadb
mysql_install_db --verbose --user=hadley --basedir=/usr/local \
  --datadir=/User/hadley/db/mariadb --tmpdir=/tmp

mysqld --datadir='/Users/hadley/db/mysql'

mysql -u root -e "CREATE DATABASE lahman;"
mysql -u root -e "CREATE DATABASE nycflights13;"
mysql -u root -e "CREATE DATABASE test;"
```

## Start

```
mysqld --datadir='/Users/hadley/db/mysql'
```

## Connect

```{r, eval = FALSE}
install.packages("RMariaDB")

con <- dbConnect(RMariaDB::MariaDB(), dbname = "lahman", username = "root", password = "")
dbListTables(con)
```

# Shut down

```
mysqladmin shutdown -u root -p
```
