현재 접속자
# mysql -u root -p
# show databases;# create database DB명;
# use DB명;
# create user '계정'@'접속위치' identified by '패스워드';
ex) create user 'test'@'127.0.0.1' identified by 'Password'; -- 내부접속만 허용
ex) create user 'test2'@'%' identified by 'Password'; -- 외부접속 허용
# grant all privileges on DB이름.테이블 to '계정'@'접속위치';
ex) grant all privileges on testDB.* to 'test2'@'%'; p.s mariadb 11.4 버전부터 권한 주실 때 패스워드 같이 써 주셔야 합니다. grant all privileges on testDB.* to 'test2'@'localhost' dentified by 'Password';
# flush privileges;
# show grants for '계정'@'접속위치';
# drop user '계정아이디'@'접속위치'; --> 계정삭제
# reboke all on DB이름.테이블 from '계정아이디'@'접속위치'; --> 권한 삭제 출처 : https://dukkoong.tistory.com/32