My Blog List

Sunday, July 28, 2013

Mysql Install

1. yum 방식을 이용한 설치
[의존성 패키지]
mysql / mysql-server / mysql-connector-odbc / mysql-devel
yum -y install mysql mysql-server mysql-connector-odbc mysql-devel
-y 옵션은 [yes/no] 선택시 자동으로 yes를 처리하게해주는 옵션
2. 설정파일 복사
# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
설치되는 서버의 메모리용량에 따라 최적화된 설정파일을 복사해준다. 보통 2G이상의 메모리를 설치하므로 my-huge.cnf를 복사한다.
my-huge.cnf 1~2G
my-large.cnf 512M
my-medium.cnf 128M~ 256M
my-small.cnf 64M 이하
** UTF8 인코딩 셋을 사용하기 위한 설정파일 내용 변경
# vi /etc/my.cnf
[client]
default-character-set = utf8
[mysqld]
init_connect = SET collation_connection = utf8_general_ci
init_connect = SET NAMES utf8
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci
[mysqldump]
default-character-set=utf8
[mysql]
default-character-set=utf8
3. DB파일 설치경로
/var/lib/mysql/mysql/ 경로아래에 DB파일이 위치한다.
4. 기본 mysql DB 인스톨 및 권한 변경
mysql_install_db && chown -R mysql:mysql /var/lib/mysql/
5. mysql 데몬 실행
ㄱ) 직접 실행
/etc/rc.d/init.d/mysqld start
/etc/rc.d/init.d/mysqld stop
/etc/rc.d/init.d/mysqld restart
ㄴ) 서비스 등록
chkconfig — add mysqld
chkconfig –level 2345 mysqld on
chmod 755 /etc/rc.d/init.d/mysqld
ㄷ) 자동서비스 선택
[root@localhost test]# ntsysv
[*] mysqld
7. 패스워드 변경 및 등록
ㄱ) sql 에서 실행
mysql > update user set password = password(‘비밀번호’) where user = ‘사용자’;
mysql > flush privileges; (* 적용하기)
ㄴ) 명령어 실행
#mysqladmin -u 사용자 password 비밀번호
8. sql script 실행
#mysql -u 사용자 -p 비밀번호 mysql < 파일명.sql

Monday, July 22, 2013

Linux How to see the log trying to access

This one is Access Log
1. cat /var/log/secure


This one is Success Access Log
2. last

Sunday, July 14, 2013

IIS ASP ERROR detail

1. IIS 설정 변경
IIS 관리자 ->  ASP 아이콘 더블클릭 -> 브라우져에 오류전송 : True
                                                                   서버쪽 디버깅 사용 : False
                                                                   클라이언트 디버깅 사용 : True

IIS 관리자 -> 오류페이지 더블클릭 -> 500 에러 오른쪽 마우스 클릭 -> 기능설정 편집
                                                                                                ->자세한 오류 라디오 버튼 체크

2. WebBrowser 설정
도구 --> 인터넷 옵션 --> 고급
HTTP 오류 메세지 표시 체크 해제

짜잔 완성

Monday, July 8, 2013

splice in javascript

<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to add elements to the array.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.splice(2,0,"Lemon","Kiwi");
var x=document.getElementById("demo");
x.innerHTML=fruits;
}
</script>
</body>
</html>

any way splice meaning is remove 0(count) from 2 line and add Lemon, Kiwi in array

about:blank in webpage

I wanted to look for how i can show in blank page in website.

that is what i fount about:blank

this will show you nothing but white blank page

Thursday, July 4, 2013

autoCommit off in mssql 2008

if you you use this tool Microsoft SQL Server Management Studio

follow this step

1. tool -> option -> query execute -> sql server -> ANSI -> SET Implicity_transactions check

important thing is open new Query Tap

Tuesday, July 2, 2013

sqlcmd in SQL SERVER

check if server pipe is available

if not check and restart

and

cmd

>sqlcmd -S DAVID-PC\SQLEXPRESS

Monday, July 1, 2013

APK download internal storage and install

1. First Download
            URL url = new URL(params[0]);
            URLConnection connection = url.openConnection();
            connection.setConnectTimeout(5000);
            connection.setReadTimeout(5000);
            connection.connect();
            // this will be useful so that you can show a typical 0-100% progress bar
            int fileLength = connection.getContentLength();
     
            File mkDir = mActivity.getDir("assets", Activity.MODE_WORLD_READABLE | Activity.MODE_WORLD_WRITEABLE);
            String path = mkDir.getAbsolutePath();
            Log.d("need", "ApkDownload Location : " + path);
           
         checkMemory(fileLength);  

            // download the file
            input = new BufferedInputStream(url.openStream());
            output = mActivity.openFileOutput(APK_FILE_NAME,
              Activity.MODE_WORLD_READABLE | Activity.MODE_WORLD_WRITEABLE);
//            output = new FileOutputStream(mActivity.getFilesDir().getAbsoluteFile() + File.separator + APK_FILE_NAME);
//            output = new FileOutputStream(SDCardRoot + File.separator + APK_FILE_NAME);
            Log.d("need", "ApkDownload Location : " + path);

            byte data[] = new byte[1024];
            long total = 0;
            int count;
            while ((count = input.read(data)) != -1) {
                total += count;
                // publishing the progress....
                progressPercent =(int) (total * 100 / fileLength);
                publishProgress();
                output.write(data, 0, count);
            }

            output.flush();
            output.close();
            input.close();


2. Second Install
File fileLocation = new File(mActivity.getFilesDir(), ApkFileDownloadTask.APK_FILE_NAME);
         
Log.d("need", "apkFile isFile" + fileLocation.isFile());
Log.d("need", "apkFile getName" + fileLocation.getName());
Log.d("need", "apkFile getAbsolutePath" + fileLocation.getAbsolutePath());
Log.d("need", "apkFile getAbsolutePath" + fileLocation.length());
         
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(fileLocation), "application/vnd.android.package-archive");

startActivity(intent);