디지털 오션 Centos7에 MariaDB 설치하기
https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-centos-7
설치
sudo yum install mariadb-server
기동
sudo systemctl start mariadb
기동상태확인
sudo systemctl status mariadb
옵션)부팅시에 자동으로 기동되도록 설정
sudo systemctl enable mariadb
root 패스워드와 외부 접속 설정
sudo mysql_secure_installation
Enter current password for root (enter for none): 이럴때는 엔터
set root password :Y
remove anonymous users Y
disallow root login remotely y
remove test database and access to it y
reload priviliege tables now y
접속
mysql -u root -p
show databases;
계정추가
use mysql;
CREATE USER 'istoryful'@'%' IDENTIFIED BY '820820';
grant all privileges on *.* to istoryful@'%' WITH GRANT OPTION;
show grants for 'istoryful'@'%';
flush privileges;
SELECT Host, User, Super_priv FROM mysql.user WHERE User='istoryful' AND Host='%';
캐릭터셋 설정
cd /etc/my.cnf.d/
sudo vi client.cnf
[client]
default-character-set = utf8
sudo vi mysql-clients.cnf
[mysql]
default-character-set = utf8
[mysqldump]
default-character-set = utf8
sudo vi server.cnf
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
sudo service mariadb restart
시스템의 캐릭터셋 확인
show variables like 'char%';
접속
mysql -u istoryful -p
기존 테이블의 캐릭터셋 변경
alter table COLLECTIVE_LINK convert to character set utf8;
데이터베이스 만들기
create database easywhooing;
'호스팅_서버_툴 > 서버' 카테고리의 다른 글
앱)AWS 스터디 정리1 (0) | 2018.11.13 |
---|---|
앱)리눅스 alias (0) | 2018.03.27 |
server refused our key (0) | 2018.03.25 |
디지털 오션 리눅스(CENTOS7)에 자바 개발환경 설치 (0) | 2018.03.25 |
디지털 오션 리눅스(CENTOS7)에 최초환경 설정(계정추가 및 SSH데몬설정) (0) | 2018.03.25 |