디지털오션 Centos6에서 mariaDB 설치하기

Posted by HULIA(휴리아)
2017. 5. 20. 14:53 호스팅_서버_툴/서버

===============================DB설치
mariadb 5.5 설치
workbench 이용 가능


vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB-5.5.39
baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/
# alternative: baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

 

sudo yum install MariaDB-server

 

sudo systemctl start mariadb  아니면   sudo /etc/init.d/mysql start

 

 

 

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;
create database easywhooing;
use mysql;
CREATE USER 'istoryful'@'%' IDENTIFIED BY '820820';
grant all privileges on easywhooing.* to istoryful@'%'
show grants for 'istoryful'@'%';
flush privileges;

 

접속
mysql -u istoryful -p

 

캐릭터셋 설정
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]
character-set-server=utf8

 

sudo service mysql restart

 

시스템의 캐릭터셋 확인

show variables like 'char%';

 

기존 테이블의 캐릭터셋 변경

alter table COLLECTIVE_LINK convert to character set utf8;