'mysql'에 해당되는 글 3건

  1. 2012.06.06 MySql 계정생성
  2. 2010.11.16 MySql DATE_FORMAT
  3. 2010.11.06 MySql insert select

MySql 계정생성

Database 2012. 6. 6. 13:51 |

create database testdb character set utf8;

create user 'test'@'localhost' identified by 'test00';

grant all privileges on testdb.* to test@'%' identified by 'test00' with grant option;

FLUSH PRIVILEGES;


jdbc:mysql://127.0.0.1:3306/testdb?useUnicode=true&characterEncoding=utf8

'Database' 카테고리의 다른 글

MySql backup(NT)  (0) 2011.07.07
MySql 백업  (0) 2011.01.21
Posted by 기계식키보드
:

MySql DATE_FORMAT

카테고리 없음 2010. 11. 16. 11:08 |
DATE_FORMAT(date,format) 

%M  Month name (January..December)   
%W  Weekday name (Sunday..Saturday)   
%D  Day of the month with English suffix (1st, 2nd, 3rd, etc.)   
%Y  Year, numeric, 4 digits   
%y  Year, numeric, 2 digits   
%X  Year for the week where Sunday is the first day of the week, numeric, 4 digits, used with \'%V\'   
%x  Year for the week, where Monday is the first day of the week, numeric, 4 digits, used with \'%v\'   
%a  Abbreviated weekday name (Sun..Sat)   
%d  Day of the month, numeric (00..31)   
%e  Day of the month, numeric (0..31)   
%m  Month, numeric (01..12)   
%c  Month, numeric (1..12)   
%b  Abbreviated month name (Jan..Dec)   
%j  Day of year (001..366)   
%H  Hour (00..23)   
%k  Hour (0..23)   
%h  Hour (01..12)   
%I  Hour (01..12)   
%l  Hour (1..12)   
%i  Minutes, numeric (00..59)   
%r  Time, 12-hour (hh:mm:ss [AP]M)   
%T  Time, 24-hour (hh:mm:ss)   
%S  Seconds (00..59)   
%s  Seconds (00..59)   
%p  AM or PM   
%w  Day of the week (0=Sunday..6=Saturday)   
%U  Week (0..53), where Sunday is the first day of the week   
%u  Week (0..53), where Monday is the first day of the week   
%V  Week (1..53), where Sunday is the first day of the week. Used with \'%X\'   
%v  Week (1..53), where Monday is the first day of the week. Used with \'%x\'   
%%  A literal `%\'.  
Posted by 기계식키보드
:

MySql insert select

Tip 2010. 11. 6. 15:13 |
insert시 max()+1을 할경우가 생겨서 다음과 같이 날렸다.

INSERT INTO rankmanage (rank,category,refseq)
  SELECT max(rank)+1, 'categoryname', 113
  FROM rankmanage
  limit 1

'Tip' 카테고리의 다른 글

css fiexed  (0) 2011.03.31
크로스도메인 쿠키문제  (0) 2011.01.21
div가운데 정렬  (0) 2010.10.09
말풍선 그럴싸한거  (0) 2010.09.26
JSP 달력 만들기  (0) 2010.09.10
Posted by 기계식키보드
: