MariaDB

sudo dnf install mariadb105-server -y
sudo systemctl enable mariadb
sudo systemctl start mariadb
# MariaDB 10.10 CentOS repository list
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.10/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
sudo yum install MariaDB-server
sudo systemctl start mariadb
sudo mariadb-secure-installation

Create Database Schema And DB User

create database devdb default character set utf8mb4 collate utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON devdb.* TO devuser@localhost IDENTIFIED BY 'devpass' WITH GRANT OPTION;

lower_case

[mariadb]
lower_case_table_names=1
create user 'devuser'@'localhost' identified by 'devpass';
grant all on devdb.* to 'devuser'@'localhost';
GRANT SELECT, SHOW VIEW ON devdb.* TO devuser2@localhost IDENTIFIED BY 'devpass';
GRANT TRIGGER, SELECT, SHOW VIEW ON devdb.* TO devuser2@localhost IDENTIFIED BY 'devpass';

DB backup

mysqldump -h localhost -u devuser -p devpass devdb > okdevdb-20180724.sql
# low CPU
mysqldump -h localhost -u devuser -p devpass --single-transaction --quick --lock-tables=false $DBNAME > okdevdb-20180724.sql

Timezone

sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
sudo service mysql restart

all process

show processlist;

Table stats

select TABLE_NAME, TABLE_ROWS
from information_schema.tables
order by 2 desc;

MariaDB on ubuntu

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.kaist.ac.kr/mariadb/repo/10.8/ubuntu trusty main'

Timestamp

MariaDB + node.js

What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee