* db 파일 물리적 위치

mysql> show variables like 'datadir';


mysql 문자 집합 설정

mysql 2014. 3. 2. 00:06
etc/my.cnf 에 등록하면 된다


참조:http://stackoverflow.com/questions/14432299/should-etc-my-cnf-be-set-to-add-character-set-server-utf8-and-default-character

 

 /etc/my.cnf.


[mysqld]

default-character-set=utf8   
character-set-server=utf8  
skip-character-set-client-handshake  
collation-server=utf8_unicode_ci  
init-connect='SET NAMES utf8'  
init_connect='SET collation_connection = utf8_general_ci'  
port = 3306



츨처:https://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html



mysql> create table test3 (a int primary key, b int ,c int);

Query OK, 0 rows affected (0.02 sec)


mysql> INSERT INTO test3 (a,b,c) VALUES (1,2,3)   ON DUPLICATE KEY UPDATE c=c+1;

Query OK, 1 row affected (0.01 sec)


mysql> select * from test3;

+---+------+------+

| a | b    | c    |

+---+------+------+

| 1 |    2 |    3 |

+---+------+------+

1 row in set (0.00 sec)


mysql> INSERT INTO test3 (a,b,c) VALUES (1,2,3)   ON DUPLICATE KEY UPDATE c=c+1;

Query OK, 2 rows affected (0.00 sec)


mysql> select * from test3;

+---+------+------+

| a | b    | c    |

+---+------+------+

| 1 |    2 |    4 |

+---+------+------+

1 row in set (0.00 sec)


mysql> INSERT INTO test3 (a,b,c) VALUES (1,2,3)   ON DUPLICATE KEY UPDATE c=c+1;

Query OK, 2 rows affected (0.00 sec)


mysql> select * from test3;

+---+------+------+

| a | b    | c    |

+---+------+------+

| 1 |    2 |    5 |

+---+------+------+

1 row in set (0.00 sec)


mysql 테이블 크기

mysql 2014. 2. 27. 11:08

출처:http://blog.mongee.net/7

select table_name,(data_length)/(1024*1024) as 'DATA(MB)',(index_length)/(1024*1024) as 'INDEX(MB)' from information_schema.tables where table_name like '%_TBL';




spring db transaction 설정

mysql 2014. 2. 26. 17:32

출처:

http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte:psl:transaction#configuration

http://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte:psl:transaction:declarative_transaction_management


*  xml 정의

<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
   <property name="dataSource" ref="dataSource"/>
</bean>
 
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
   <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
   <property name="url" value="dbc:mysql://db2:1621/rte"/>
   <property name="username" value="rte"/>
   <property name="password" value="xxx"/>
   <property name="defaultAutoCommit" value="false"/>
</bean>


(datasource.xml)


* 사용

@Transactional

public class Foo {

insert();

delete();

load_data();

}


eclipse 단축키

eclipse 2014. 2. 19. 17:13
eclipse단축키

* "alt + SHIFT + A" : 열 선택 모드 선택 해제 shift 누른 뒤 편집
* CTRL + alt + d : 한 줄 복사해서 추가
* CTRL + d : 한 줄 삭제
* CTRL + shift + L : quick text search (STS)
* CTRL + shift + u : 현재 소스에서 검색한 목록 보여준다
* CTRL + shift + y : 소문자로 변환
* CTRL + shift + x : 대문자로 변환
* CTRL + shift + r: 파일 찾기
* HOME + shift + End 한 줄 선택
* (클래스 이름 앞에서) CTRL+ shift +G : 자신을 참조하는 메소드를 보여준다
* 탭 이동 : CTRL+Page Up / CTRL+Page Down /  CTRL+F6
* (package explorer 에서 ) Home : 프로젝트 맨 상단으로 이동



설치 후 로그인 때 에러

Fatal error: Maximum execution time of 30 seconds exceeded in ... class-http.php on line 900



php.ini 에서 max_execution_time 값 늘려준다 30 -> 60



mysql default column

mysql 2014. 2. 19. 14:59

CREATE TABLE `test2` (

  `col1` int(11) DEFAULT NULL,

  `col2` int(11) DEFAULT NULL,

  `ins_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


또는 


CREATE TABLE `test2` (

  `col1` int(11) DEFAULT NULL,

  `col2` int(11) DEFAULT NULL,

  `ins_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;




http://stackoverflow.com/questions/14797194/cygwin-ls-command-not-found


objectaid 설명

java 2014. 2. 14. 11:25

http://blog.naver.com/PostView.nhn?blogId=netrance&logNo=110159806133