[설치] : centos
# yum install mariadb mariadb-server
[설치 버전확인]
# mysql --version
>select version();
[DB실행]
# systemctl start mariadb
[root 비밀번호 초기화]
# mysqladmin -u root password
[부팅시 자동 재실행]
# systemctl enable mariadb
[대소문자 구분 없애기]
> show variables like 'lower_case_table_names';
0일경우 --> 대소문자 구분함
1일경우 --> 대소문자 구분안함
vi /etc/my.cnf (centos)
vi /etc/mysql/my.cnf (ubuntu)
vi /etc/my.cnf.d/server.cnf (10.3~)
[mysqld]
lower_case_table_names=1
# systemctl restart mariadb
>show variables like 'lower_case_table_names';
[계정생성]
create user '계정명'@'%' identified by '패스워드';
[비밀번호변경]
alter user '계정명'@'%' identified by '패스워드';
commit;
[DB권한부여]
grant all privileges on db명.* to '계정명'@'%' identified by '패스워드' ;
grant all privileges on db명.* to '계정명'@'localhost' identified by '패스워드' ;
grant all privileges on *.* to '계정명'@'%' identified by '패스워드' ;
grant all privileges on *.* to '계정명'@'localhost' identified by '패스워드' ;
-------
grant all on run.* to 'run_user'@'%' with grant option;
- % : 외부접속 허용, localhost : 로컬 접속
[변경사항 적용]
flush privileges;
[권한목록]
use mysql;
select host, user from user;
[계정삭제]
delete from user where user='계정명';