Basic user management for mysql/mariadb

Create user

CREATE USER 'someone'@'localhost' IDENTIFIED BY 'password';Code language: JavaScript (javascript)

해당 계정의 외부접속을 허용하려면 특정 hostname혹은 ip를 localhost 대신 적을 수 있고, 접속을 전부 허용하려면 %를 넣으면 된다.

Create database

CREATE DATABASE someone;

Grant privileges

GRANT ALL ON someone.* to 'someone'@'localhost';Code language: JavaScript (javascript)

GRANT ALL ON database.table로 표현됨에 유의한다.

Flush privileges

flush privileges;

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *