프로그래밍/DB
-
mysql int 타입 최대/최소 값프로그래밍/DB 2017. 10. 1. 18:22
매번 테이블 만들때마다 검색하기 귀찮아서 걍 블로그 저장용 MySQL supports the SQL standard integer types INTEGER (or INT) and SMALLINT. As an extension to the standard, MySQL also supports the integer types TINYINT, MEDIUMINT, and BIGINT. The following table shows the required storage and range for each integer type. 참조: http://dev.mysql.com/doc/refman/5.5/en/integer-types.htmlhttps://zetawiki.com/wiki/MySQL_%EC%9E%90%EB..
-
mysql 두 개의 테이블 데이터 사용하기 예시들프로그래밍/DB 2017. 9. 30. 18:22
두 개의 테이블에서 칼럼들 읽어오기 (inner join) SELECT t1.*, t2.*FROM table1 t1, table2 t2WHERE t1.id = t2.t1_id 다른 테이블 정보로 칼럼 데이터 업데이트 하기 UPDATE table1 t1, table2 t2SET t1.field_to_change = t2.field_with_dataWHERE t1.field1 = t2.field2; 다른 테이블 필드 값을 추가하기 INSERT INTO tbl_temp2 (fld_id) SELECT tbl_temp1.fld_order_id FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100; 특정 문자열을 select 문과 같이 사용할 경우에는 select 문의 필드명에서..
-
리눅스와 mysql의 max_open_file 사이즈 변경하기프로그래밍/DB 2017. 5. 21. 16:15
환경: 리눅스 CentOS 새 서버를 받아 max open file 관련하여 설정을 하여 기록을 남긴다. mysql에서는 보통 max open file 기본 값으로 1024이 설정되어 있는데 이 값이 낮아 mysql 작업 속도를 느리게 하는 원인이 되기도 하니 적절하게 값을 조정해보도록 하자. 1.mysql의 max open file 설정 확인 일단 mysql 의 현재 max open file설정부터 확인해보자.ps afx | grep mysql 로 해당 프로세스의 id를 알아내고 프로세스의 설정값을 확인해본다. 1024(soft), 4096(hard) 값이 설정되어 있다. shell> ps afx | grep mysql48320 pts/3 S+ 0:00 \_ grep mysql21919 pts/0 S ..