○ 유저 추가 명령어 useradd [옵션] 유저명 옵션 설명 -d 홈 디렉토리 지정시 사용 -g 그룹 지정. 지정할 그룹이 생성되어 있어야 됨 -G 기본그룹 외에 추가로 그룹에 포함시킬 경우 사용 -c 유저에 대한 설명 지정 -s 유저가 사용할 쉘을 지정 시스템의 사용자(유저)를 확인하려면 /etc/passwd 파일을 열어보면 된다. - /etc/passwd 파일의 한 부분 # newUser:x:1001:1001::/home/newUser:/bin/bash newUser라는 사용자를 생성했더니 위와 같은 라인이 추가되어 있다. 순서대로 아이디:패스워드:유저아이디(uid):그룹아이디(gid):설명:홈디렉토리:쉘 을 나타내며 유저 생성시 -c를 이용해 설명을 적지 않아서(필요가 없으니) 빈칸으로 되어 있다..
user 생성 create user '아이디'@'localhost' identified by '비밀번호'; user 권한 부여 grant select, insert, update, delete, create, drop, alter on 지정DB이름.*to '아이디'@'localhost'; all privileges : 모든 권한 / *.* : 모든DB / with grant option : 권한위임가능 예: grant all privileges on *.* to 'project'@'%' with grant option; user 권한 보기 show grants for '아이디'@'localhost(또는%)'; 권한 적용하기 flush privileges; 모든 user 보기 use mysql; selec..
프로시저는 프로그램의 함수와 같은 개념으로 SQL명령어의 조합으로 새로운 함수를 만들어 저장 해 놓고 사용하는 것이다. > 삭제 DROP PROCEDURE IF EXISTS INSERT_BOARD; //프로시저를 생성하기 전에 INSERT_BOARD라는 프로시저가 있으면 삭제한다. > 생성 CREATE PROCEDURE INSERT_BOARD(PREGION INT(11), PWRITER VARCHAR(30), PTITLE VARCHAR(200)) BEGIN INSERT INTO BOARD(REGION, WRITER, TITLE) VALUES (PREGION,PWRITER,PTITLE); END; //보라색의 PREGION, PWRITER 등의 변수는 외부에서 함수를 호출할 때 넣어줄 인자의 타입을 결정 ..
웹서핑을 하다가 게시판 글이 과거는(어제기준) 날짜로 표기되고 금일은 시간으로 데이터가 표시되는 것을 보고 현재 공부하면서 만들고 있는 게시판의 쿼리를 바꿔보았다. (물론 뇌입원님의 은총을 받아서..) 기존에는 그냥 무책임하게 (년도 일자 오전오후 시간) 다 보여주는 형태였는데 이렇게 바꿔주니 한결 나아보인다. 애초에 화면 레이아웃이 엉망인지라(CSS를 잘몰라서 이곳저곳 오픈소스를 막 적용하다보니....) 다른 사람이 본다면 거기서 거기라고 느낄 것 같다... MYSQL에서 날짜 형식바꾸기 DATE_FORMAT(DATE,'형식문자'); //이렇게 하면된다. 아래는 형식문자에 들어갈 수 있는 문자들의 표이다. select NO, CASE WHEN DATE_FORMAT(REG_DATE,'%y.%m.%d') ..