2009년 12월 11일 금요일

입력 폼에서 enter 입력시 submit 되는 문제

인터넷을 뒤져서 알아낸 tip


<form onkeypress="if(event.keyCode==13){return false;}">

2009년 12월 6일 일요일

MAC OS X : Snow Leopard MySQL 설치

1. MySQL 설치


   packeg version이 있어서 다운로드하면 됨..




If you have installed the Startup Item, use this command:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start (ENTER YOUR PASSWORD, IF NECESSARY) (PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)


If you don't use the Startup Item, enter the following command sequence:
shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safe (ENTER YOUR PASSWORD, IF NECESSARY) (PRESS CONTROL-Z) shell> bg (PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)
You should be able to connect to the MySQL server, for example, byrunning `/usr/local/mysql/bin/mysql'.

or, if you setting PATH in the .bash_profile, you should be able to connect to the MySQL
(ex. export PATH=${PATH}:/usr/local/mysql/bin)and then, you can connect to the MySQL writting mysql in the terminal


MYSQL.prefPane (서버를 실행하거나 중지하는 프로그램) 설치 
 : 설치 후  시스템환경설정에서 MySQL 아이콘을 눌러서 서버를 시작한다.


시작 : terminal에서 mysql 적고 엔터
빠져나오기 : mysql>QUIT or ctrl-D
하지만 terminal에서 db 제어는 힘드니까







2. MySQL TOOL을 다운받는다.


MySQL Query Browser 실행
username 으로  root를 넣는다.(아래 mysqlaccess.conf 파일 내용 참조)



















../../usr/local/mysql/bin/mysqlaccess.conf 의 파일 내용


# ----------------## Global settings ## --------------- 

# #$Param{'host'} = ''; 
$Param{'user'} = 'nobody'; 
$Param{'db'} = 'test'; 
$Param{'password'} = 'foobar'; 
$Param{'debug'} = 0;
# --------------------------## Settings for Command-line ## -------------------------

#if ($CMD) { $Param{'superuser'} = 'root'; 
$Param{'rhost'} = 'localhost'; 
$Param{'spassword'} = ''; 
$Param{'brief'} = 1;}
# ---------------------## Settings for CGI-BIN ## -------------------- 

#if ($CGI) { $Param{'superuser'} = 'root'; 
$Param{'rhost'} = 'localhost'; 
$Param{'spassword'} = ''; 
$Param{'table'} = 1;}
1; #to make require happy



2009년 12월 3일 목요일

MAC OS X : Snow Leopard 에 Tomcat 설치







위 책을 참조해서 설치 했다..


1. tar.gz 톰캣을 다운 받은 후

    sudo mv apache-tomcat-6.0.14 /usr/local/

    sudo ln -s /usr/local/apache-tomcat-6.0.14/ /usr/local/tomcat




.bash_profile에 또는 /etc/profile에
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/usr/local/tomcat



2. 실행 및 중지

   $ sudo /usr/local/tomcat/bin/startup.sh
   $ sudo /usr/local/tomcat/bin/shutdown.sh


   또는 export PATH=${PATH}:/usr/local/tomcat/bin 설정 하면
   terminal에서 아래 명령만 주면 된다.

   $ sudo startup.sh
   $ sudo shutdown.sh  




3. 톰캣이 실행이 되어있는지 보려면

   $ netstat -an | grep 8080





맥을 사용한지 2주일정도 되는데 설치된 폴더를 찾기위해서

finder에서 표시가 되지 않는

/usr/local/ 과 /etc/profile을 찾는데 한참이 걸렸다

../../usr/local 에 있다는것을 나중에 찾음..