목록개발/MySQL (5)
웁스교교주의 이야기
mysql> SET foreign_key_checks = 0; mysql> drop table … mysql> SET foreign_key_checks = 1;
나의 업무 특성상 요일을 한글로 출력해야 할 때가 있다이럴 경우 아래와 같은 방법을 응용해서 사용하고 있다.SELECT SUBSTR( _UTF8’월화수목금토일’,WEEKDAY(NOW())+1,1)
mysqldump를 사용하면 자동으로 table lock이 걸린다.그럴 경우 –single-transaction 옵션으로 lock를 안 걸리게 할 수 있다mysqldump -h 아이프 -u 유저 -p패스워드 –single-transaction DB명 > 파일명요렇게 사용하면 된다.
머리가 나뻐서 week 함수를 쓸 때마다사용법이 아리까리 하다..난 머리가 안 좋으므로정리하기로 했다 .ㅎㅎㅎㅎ아래 표 참고요~좀 외우자 ㅎㅎModeFirst day of weekRangeWeek 1 is the first week …0Sunday0-53with a Sunday in this year1Monday0-53with more than 3 days this year2Sunday1-53with a Sunday in this year3Monday1-53with more than 3 days this year4Sunday0-53with more than 3 days this year5Monday0-53with a Monday in this year6Sunday1-53with more than 3 da..