C:\Windows\system32>mysql -u root -p -- root 계정으로 접속합니다.
Enter password: **** -- root 게정 비밀번호를 입력합니다.
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.19-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database demo; -- demo 라는 명을 가지는 데이터베이스를 생성합니다.
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> show databases; -- 데이터베이스 목록을 확인합니다.
+--------------------+
| Database |
+--------------------+
| demo | -- 생성완료
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
MariaDB [(none)]>
-- demo 라는 명을 가지는 데이터베이스를 삭제합니다.MariaDB [(none)]> drop database demo; 로컬 호스트만 접속
create user 'tester'@'localhost' identified by '1111';
아무데서나 접속 가능
create user 'username'@'%' identified by 'password';
-- tester 계정에게 demo 데이터베이스의 모든 사용권한을 부여한다.-- '%' 대신 localhost를 사용할 경우 외부에서 접속 불가grant all privileges on demo.* to tester@'%';
사용자 비빌 번호 변경
use mysql;update user set password=PASSWORD('변경할비밀번호') where user = '사용자계정';flush privileges;
댓글 없음:
댓글 쓰기