MySQL, 3일차 (2)
MySQL 8.0 Command Line Client에 비밀번호를 입력하고 들어간다create user 'apple'@'localhost' identified by '1111'; user 계정과 비밀번호를 생성하고, use mysql;select user, host from user;사용자 목록을 조회 한다. 할당 권한 상세 옵션- create, drop, alter : 테이블에 대한 생성, 삭제, 변경 권한 - select, insert, update, delete: 테이블의 데이터를 조회, 삽입, 변경, 삭제에 대한 권한- all : 모든 권한- usage: 권한을 부여하지 않고 계정만 생성grant 권한 on 데이터베이스명, 테이블명 to '사용자'@'localhost';grant all on *...
MySQL, 3일차 (1)
MySQL 문자열 함수concat : 복수의 문자열을 연결해 주는 함수select concat('안녕하세요, 'MySQL') as concat;select concat(address1, ' ', address2, ' ', address3) as addressfrom member where userid='apple'; left, right : 왼쪽 또는 오른족에서 길이만큼 문자열을 가져옴 select left('ABCDEFGHIJKLMN', 5);select userid, left(userpw, 2) as password from member; substring : 문자열의 일부를 가져옴- substring(문자열, 시작위치): 시작위치부터 끝까지 - substring(문자열, 시작위치, 길이) : 시작..