달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
.. .. ..

Redmine 에서 Back-End 로 사용하는 DB중에는 Oracle 이 공식적으로는 없다.

 

하지만 블로그 링크를 통해 아래 경로를 추천하였으며 그에 대한 정리를 한다.

 

블로그 경로 : [http://matthewrupert.net/2011/03/11/running-redmine-with-an-oracle-backend/]

 

1. Oracle sees ” and “null” as the same thing.
The biggest issue is the fact that Oracle see ” and ‘null’ as the same thing. That said, there are a few setup scripts that will need modified. I went through db/migrate/001_setup.rb and looked for everything that sets a default value of ” and told it to allow nulls for any such column.

For example, the users table is created like this:

create_table “users”, :force => true do |t|
t.column “login”, :string, :limit => 30, :default => “”, :null => true
t.column “hashed_password”, :string, :limit => 40, :default => “”, :null => true
t.column “firstname”, :string, :limit => 30, :default => “”, :null => true
t.column “lastname”, :string, :limit => 30, :default => “”, :null => true
t.column “mail”, :string, :limit => 60, :default => “”, :null => true
t.column “mail_notification”, :boolean, :default => true, :null => false
t.column “admin”, :boolean, :default => false, :null => false
t.column “status”, :integer, :default => 1, :null => false
t.column “last_login_on”, :datetime
t.column “language”, :string, :limit => 2, :default => “”, :null => true
t.column “auth_source_id”, :integer
t.column “created_on”, :timestamp
t.column “updated_on”, :timestamp
end

…and versions:

create_table “versions”, :force => true do |t|
t.column “project_id”, :integer, :default => 0, :null => true
t.column “name”, :string, :limit => 30, :default => “”, :null => true
t.column “description”, :string, :default => “”
t.column “effective_date”, :date, :null => true
t.column “created_on”, :timestamp
t.column “updated_on”, :timestamp
end

I’m simply allowing nulls where before null was no longer accepted. This shouldn’t be a problem, its just a lacking database constraint. I’ll definitely follow up if it does become a problem.

There are a few other places where you’ll have to make similar changes:

  • 074_add_auth_sources_tls.rb
  • 091_change_changesets_revision_to_string.rb
  • 108_add_identity_url_to_users.rb
  • 20091017214336_add_missing_indexes_to_users.rb

-- 오라클에서는 " 라는 값도 null로 인식한다는 뜻 같은데.. 정확하게는 알수가 없어 위에 시키는대로 따라하였다.

    20091017214336_add_missing_indexes_to_users.rb 파일에서는 딱히 수정할것이 없어 수정하지 않았다.

 

2. Version Effective Date:
Oracle won’t like the syntax of 048_allow_null_version_effective_date.rb. I simply removed this file (it appears that this was a later change in Redmine) and made the version effective data column nullable in 001_setup.rb like this:

create_table “versions”, :force => true do |t|
t.column “project_id”, :integer, :default => 0, :null => true
t.column “name”, :string, :limit => 30, :default => “”, :null => true
t.column “description”, :string, :default => “”
t.column “effective_date”, :date, :null => true
t.column “created_on”, :timestamp
t.column “updated_on”, :timestamp
end

 

-- 오라클에서는 필요 없는 기능이라는 의미 같은데.. 일단 삭제하라는 파일은 삭제하였고 versions 부분은 1번에서

    동일하게 변경하였기 때문에 수행하지 않았다.

 

3. The UTF-8 Problem
Assuming your Oracle database uses AL32UTF8, you’ll want to do something like this in environment.rb:

ENV['NLS_LANG']=’american_america.AL32UTF8′

 

-- UTF-8 을 사용할때의 옵션같다. 저는 한글을 쓰기 때문이 이 기능에 대해서 적용하지 않았습니다

 

4. Oracle 30-character limitation on table names
Oracle limits table names to 30 characters in length. This is a problem in one particular Redmine db migration script: 107_add_open_id_authentication_tables.rb
I changed this file to use smaller table names:

class AddOpenIdAuthenticationTables < ActiveRecord::Migration
def self.up
create_table :open_id_auth_associations, :force => true do |t|
t.integer :issued, :lifetime
t.string :handle, :assoc_type
t.binary :server_url, :secret
end

create_table :open_id_auth_nonces, :force => true do |t|
t.integer :timestamp, :null => false
t.string :server_url, :null => true
t.string :salt, :null => false
end
end

def self.down
drop_table :open_id_authentication_associations
drop_table :open_id_authentication_nonces
end
end

 

-- 글자수 제한 관련한 수정이다. 위와 같이 따라하면 된다.

 

5. A problem with the Activity Tab
There a problem with Oracle CLOB String comparison (as in, you can’t compare a CLOB to a String). This is documented here: http://www.redmine.org/issues/3699
Unfortunately, the Redmine response is always “Oracle is not supported.” Hey, I don’t care for being stuck with Oracle either, but some of us are. Anyway, you can take care of this problem with a simple change to the comparison. Change redmine/app/models/journal.rb:

acts_as_activity_provider :type => ‘issues’,
:permission => :view_issues,
:author_key => :user_id,
:find_options => {:include => [{:issue => :project}, :details, :user],
:conditions => “#{Journal.table_name}.journalized_type = ‘Issue’ AND” +
” (#{JournalDetail.table_name}.prop_key = ‘status_id’ OR length(#{Journal.table_name}.notes) > 0)”}

 

 

-- 시키는대로 변경한다.

 

8. Change the sequences
Before you get moving, you’re probably going to want to fix the table sequences, setting them to start at 1. This is just a matter of preference, but at least for the ISSUES_SEQ, since the unique ID is used to identify the ticket, it makes sense to start with lower numbers. For some reason that I don’t understand (yet), Oracle 11 starts sequences at 10,000. I recommend doing this:

DROP SEQUENCE REDMINEUSER.ISSUES_SEQ;
CREATE SEQUENCE ISSUES_SEQ
START WITH 1
MAXVALUE 9999999999999999999999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER;
Now your tickets will start with lower numbers. As far as other sequences go, it doesn’t matter too much, since we generally don’t view the id columns.

 

-- 시키는대로 따라한다.. (사실 난 안해도 잘돌아가서 안했지만;;)

 

9. Annoyingly Short VARCHAR2 Defaults
The default VARCHAR2 setting is going to be VARCHAR2(255). When it comes to certain fields, such as the project description, this is a little on the short side. I went ahead and modified the column width myself:

alter table PROJECTS modify description VARCHAR2(4000);

commit;

 

//2013.12.10 추가. 아래 테이블의 컬럼값도 변경되야 한다.

alter table journal_details modify VALUE VARCHAR2(4000);
alter table journal_details modify OLD_VALUE VARCHAR2(4000);

 

-- 이미 버그로 인식해서 수정했던 부분이었기 때문에 적용하진 않았지만 꼭 해둘필요가 있다.

 

10. Database Trigger Needed to Copy Workflows
When creating a Tracker, Redmine allows a user to “Copy from existing workflow.” (I.e., You can copy the Tracker workflow from an existing Tracker, making the process of adding a new Tracker much more quick.) This creates a possible error when inserting the new workflow into the Workflows table because for some reason (and I’m not yet sure why), no trigger was created on the Oracle database. Without this trigger you will see a “Cannot insert null” error in your production log file if you attempt to copy a workflow. To get around this problem it is easy enough to create a trigger on the Workflows table:


CREATE OR REPLACE TRIGGER workflows_before_insert
BEFORE INSERT
ON WORKFLOWS
FOR EACH ROW
BEGIN
if :new.id is null then
SELECT workflows_seq.nextval INTO :new.ID FROM dual;
end if;
END;
/

 

-- 영어 해석이 되지 않아 무슨소린지 몰라서 일단 생성만 해두었다.

11. Database connection
Finally, database.yml will end up looking something like this:

production:
adapter: oracle_enhanced
database:
host:
port: username: redmine_db_user
password: redmine_db_pass

These changes are very important to note should you ever have to upgrade Redmine.

 

--위같이 설정하면 끝!!!!!!! 인줄 알았지만 버젼 업은 되었지만 블로그 글은 업이 되지 않았다는것.

  추가적으로 아래 내용도 적용한다.

 

12. app/views/issues/_attributes.html.erb 수정

 

 

 

- <p><%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('start_date') %><%= calendar_for('issue_start_date') if @issue.leaf? %></p>
+ <p><%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('start_date'), :value => @issue.start_date ? @issue.start_date.strftime(Setting.date_format) : "" %><%= calendar_for('issue_start_date') if @issue.leaf? %></p>

-- 윗줄의 내용을 아래와 같이 변경한다. start_date 뿐만 아니라 due_date 도 같이 변경해준다.

-- 이슈 업데이트 문제를 해결해 준다.

 

13. config/init..../oracle.rb 추가 (파일이 없으니 추가한다!) 

ActiveSupport.on_load(:active_record) do
ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter.class_eval do
self.emulate_dates_by_column_name = true
end
end
-- 안되던 간트차트가 뿅하고 나올것이니라

 

14. app/models/query.rb
수정
def has_column?(column)
+ return false if !column_names.kind_of?(Array)
column_names && column_names.include?(column.is_a?(QueryColumn) ? column.name : column)
end

-- return 줄을 추가한다.

 

이상입니다.

댓글 및 질문 받지만 도와드릴수 있을지는 미정입니다^^;

.
:
Posted by .07274.
2013. 11. 11. 20:56

mysql 데이터 저장 디렉토리 변경 I.lib()/I.lib(Mysql)2013. 11. 11. 20:56

.. .. ..

1. 디렉토리 생성

 

2. 권한 변경

 

3. mysql 정지

 

4. 설정파일 수정

  : /etc/my.cnf & /etc/init.d/mysqld 파일의 datadir 부분 변경

 

5. mysql 시작

 

 

.
:
Posted by .07274.
.. .. ..

Linux에 무료 웹서버인 Apache를 설치하는 방법을 정리 해 보았습니다.

1. 다운로드 및 압축풀기
2. 구성
3. 컴파일 및 설치
4. 설정
5.실행

1. 다운로드 및 압축풀기
아래 사이트에서 최신버전을 아파치를 다운 받으세요.

http://httpd.apache.org/
(제가 받은 파일은 httpd-2.2.17.tar.gz 입니다.)

다운 받은 파일을 서버의 설치할 곳(예:/usr/local/)에 올리시고 압축을 풀어 주세요.
$ gunzip httpd-2.2.17.tar.gz
$ tar xvf httpd

2. 구성
최상위 디렉토리에서 ./configure를 입력한다.
$ ./configure
만약 설치 디렉토리를  지정할 경우에는 prefix 옵션을 사용한다.
$ ./configure –prefix=설치디렉토리(예:/usr/local/apache)
*몇분정도걸림.

3. 컴파일 및 설치
구성이 완료되면 make를 실행하여 컴파일 한다.
$ make
컴파일이 완료되면 아래 명령어를 사용하여 설치 한다.
$ make install

4. 환경설정
설치디렉토리/conf/httpd.conf 파일을 수정한다.
$ vi httpd.conf
ServerRoot “/usr/local/apache” –> 설치 디렉토리로 변경
Listen xxx.xxx.xxx.xxxx:80 –> 설치 서버 IP로 변경
ServerName localhost –>서버네임을 localhost로 변경
DocumentRoot “/home/webuser/webapps” –> html 홈 디렉토리 변경
:wq(vi에디터 저장 후 종료)

5.실행
설치디렉토리/bin/에서 다음 명령 실행
$ apachectl start
브라우저에서 해당서버 URL을 입력했을때

It works!

라는 문구가 보이면 설치가 완료된 것입니다.

 

 

작업중 Error 발생시 아래 참조

 

1. http://blog.naver.com/PostView.nhn?blogId=mook7508&logNo=120158730601

 

2. http://windowx.tistory.com/363

 

 

-- 에러 파일 설치 방법

 

apache 설치

mkdir -p /myhome/INSTALL/apache
cd /myhome/INSTALL/apache
wget "http://apache.tt.co.kr/httpd/httpd-2.4.3.tar.gz" ./
tar -xvzf httpd-2.4.3.tar.gz
cd httpd-2.4.3

./configure \
--prefix=/myhome/apps/apache \
--enable-mods-shared=all \
--enable-so \
--enable-rewrite

위와 같이 apache 2.4 버전대의 파일을 configure하려고 하면 아래와 같은 오류를 확인할 수 있다.

configure: error: APR not found. Please read the documentation

 

apache 2.4 버전 설치부터는 아래의 모듈이 서버에 설치되어 있어야 한다.

apr (Apache Portable Runtime)

 - http://en.wikipedia.org/wiki/Apache_Portable_Runtime

apr-util

pcre (Perl Compatible Regular Expressions)

- http://en.wikipedia.org/wiki/Pcre

 

apr 설치

mkdir -p /myhome/INSTALL/apr
cd /myhome/INSTALL/apr
wget "http://apache.mirror.cdnetworks.com//apr/apr-1.4.6.tar.gz" ./
tar -xvzf apr-1.4.6.tar.gz
cd apr-1.4.6

./configure \
--prefix=/myhome/apps/apr
make && make install

 

apr-util 설치

mkdir -p /myhome/INSTALL/apr-util
cd /myhome/INSTALL/apr-util
wget "http://apache.mirror.cdnetworks.com//apr/apr-util-1.4.1.tar.gz" ./
tar -xvzf apr-util-1.4.1.tar.gz
cd apr-util-1.4.1

./configure \
--prefix=/myhome/apps/apr-util \
--with-apr=/myhome/apps/apr
make && make install

 

pcre 설치

mkdir -p /myhome/INSTALL/pcre
cd /myhome/INSTALL/pcre
wget "http://sourceforge.net/projects/pcre/files/pcre/8.31/pcre-8.31.tar.gz/download" ./
tar -xzvf pcre-8.31.tar.gz
cd pcre-8.31

./configure \
--prefix=/myhome/apps/pcre
make && make install

 

위 방법이 되지 않을시에는 아래와 같은 명령 사용

yum install pcre-devel

 

 

## Mod_jk 설정

Tomcat 과 연동을 하기 위한 Connector(mod_jk) 를 설치한다.

 

1) http://tomcat.apache.org/connectors-doc/ 에서 1.2.15 소스를 다운받음.

2) 소스 압축풀고 jk/native 디렉토리에 들어가서 루트권한으로..
# ./configure --with-apxs=/usr/local/apache/bin/apxs
# make
# make install 하면
mod_jk.so 파일이 /usr/local/apache/modules 에 생성됨 , 만약 없으면 컴파일한 곳에서
복사해서 apache/modules 디렉토리로 복사함. 이 mod_jk.so 파일 하나만 필요함.

 

==== apache2 와 연동하기 ====

1) /usr/local/apache/conf 디렉토리에 mod_jk.conf 파일 생성
(예제 파일 - /examples context 를 샘플로 사용)
Alias /examples /usr/local/tomcat/webapps/examples
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "

 

.
:
Posted by .07274.
.. .. ..


[펌] : http://jmnote.com/wiki/Httpd

.
:
Posted by .07274.
2013. 11. 8. 16:25

[펌] 리눅스에서 Mysql 설치 I.lib()/I.lib(Mysql)2013. 11. 8. 16:25

.. .. ..

MySQL DBMS 를 설치할 때 제가 적용하는 내용을 공유합니다.
root 계정으로 설치 준비를 하고, mysql 계정으로 DB를 구동합니다.
일단 하단 내용들은 root계정으로 수행을 합니다. 

OS 계정 추가

다음과 같이 dba 그룹을 추가하고 그 밑에 mysql 계정을 추가합니다.

1
2
3
groupadd -g 600 dba
useradd -g 600 -u 605 mysql
passwd mysql

Linux 설정 변경

세션 Limit 를 설정합니다.

1
2
3
4
5
6
vi /etc/security/limits.conf
##하단 내용 추가
mysql            soft    nproc  8192
mysql            hard    nproc  16384
mysql            soft    nofile 8192
mysql            hard    nofile 65536

OS에서 limits.conf 파일을 읽어들이도록 설정합니다. 없으면 생성합니다.

1
2
3
vi /etc/pam.d/login
## 하단 내용 추가
session    required     pam_limits.so

/etc/profile 에 다음 내용을 추가하여 login 시 적용되도록 합니다.

1
2
3
4
5
6
7
8
9
10
vi /etc/profile
##
if [ $USER = "mysql" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

MySQL 데이터 저장 디렉토리를 생성합니다.

1
2
3
4
mkdir -p /data/mysql/mysql-data
mkdir -p /data/mysql/mysql-tmp
mkdir -p /data/mysql/mysql-iblog
mkdir -p /data/mysql/mysql-binlog

MySQL 설치 파일 다운로드

하단 실행 시 x86_64 가 있으면 64비트이고, i686 이 있으면 32비트입니다.

1
2
3
## OS 버전 확인 ##
uname -a
Linux ..중략.. EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

이제 MySQL Download 의 “Linux – Generic” 탭에서 자신의 OS에 맞는 MySQL Server 받으세요. 현재 Release되는 주 버전은 MySQL 5.5.x이나, 여기서는 MySQL 5.1.57 64비트 버전으로 설명드리겠습니다.
굴욕적이지만, 한국보다는 일본 mirror서버에서 받는 것이 빠르다는..-_-;;

1
2
3
cd /usr/local/
## 설치 파일 다운로드
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.19-linux2.6-x86_64.tar.gz/from/http://ftp.iij.ad.jp/pub/db/mysql/

MySQL 기본 설정

시스템에 따라 데이터 파일과 같은 일부 변수 값이 달라질 수 있으니, 자신의 시스템에 맞게 수정해서 사용하세요.

1
vi /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock

[mysqld]
# generic configuration options
port = 3306
socket = /tmp/mysql.sock

back_log = 100
max_connections = 500
max_connect_errors = 10
table_open_cache = 2048
max_allowed_packet = 16M
join_buffer_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
bulk_insert_buffer_size = 16M
thread_cache_size = 128
thread_concurrency = 16
query_cache_type = 0
default_storage_engine = innodb
thread_stack = 192K
lower_case_table_names = 1
max_heap_table_size = 128M
tmp_table_size = 128M
local_infile = 0
max_prepared_stmt_count = 256K
event_scheduler = ON
log_bin_trust_function_creators = 1
secure_auth = 1
skip_external_locking
skip_symbolic_links
#skip_name_resolve

## config server and data path
basedir = /usr/local/mysql
datadir = /data/mysql/mysql-data
tmpdir = /data/mysql/mysql-tmp
log_bin = /data/mysql/mysql-binlog/mysql-bin
relay_log = /data/mysql/mysql-binlog/mysql-relay
innodb_data_home_dir = /data/mysql/mysql-data
innodb_log_group_home_dir = /data/mysql/mysql-iblog

## config character set
##utf8
character_set_client_handshake = FALSE
character_set_server = utf8
collation_server = utf8_general_ci
init_connect = "SET collation_connection = utf8_general_ci"
init_connect = "SET NAMES utf8"

## bin log
binlog_format = row
binlog_cache_size = 4M

## Replication related settings
server_id = 1
expire_logs_days = 7
slave_net_timeout = 60
log_slave_updates
#read_only

## MyISAM Specific options
key_buffer_size = 32M
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 16M
myisam_repair_threads = 1
myisam_recover = FORCE,BACKUP

# *** INNODB Specific options ***
innodb_additional_mem_pool_size = 16M
innodb_buffer_pool_size = 2G

innodb_data_file_path = ibdata1:1G:autoextend
innodb_file_per_table = 1
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 8M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_flush_method = O_DIRECT
innodb_lock_wait_timeout = 120
innodb_support_xa = 0
innodb_file_io_threads = 8

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no_auto_rehash

[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 512M
read_buffer = 8M
write_buffer = 8M

[mysqlhotcopy]
interactive_timeout

[mysqld_safe]
open_files_limit = 8192

MySQL Server 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
## 압축 해제
cd /usr/local
tar xzvf mysql-5.5.19-linux2.6-x86_64.tar.gz
## 관리를 위한 심볼릭 링크 생성
ln -s mysql-5.5.19-linux2.6-x86_64 mysql
## 설치 파일 권한 변경
chown -R mysql.dba /usr/local/mysql*
## 시작 스크립트 복사
cp mysql/support-files/mysql.server /etc/init.d/mysqld
## 관련 파일 권한 설정
chown mysql.dba /data/mysql/*
chown mysql.dba /etc/my.cnf
chown mysql.dba /usr/local/mysql*


여기서부터는 이제 mysql 계정으로 실행을 합니다.
관리를 위해서 몇몇 alias를 설정하는 부분입니다.^^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
su - mysql
cat >> ~/.bash_profile
## 하단 내용 입력
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin:.
export ADMIN_PWD="ROOT 패스워드"
 
alias ll="ls -al --color=auto"
alias mydba="mysql -uroot -p$ADMIN_PWD"
alias mymaster="mysql -uroot -p$ADMIN_PWD -e'show master status;'"
alias myslave="mysql -uroot -p$ADMIN_PWD -e'show slave status\G'"
alias mh="cd $MYSQL_HOME"
alias md="cd /data/mysql/mysql-data"
alias mt="cd /data/mysql/mysql-tmp"
alias mb="cd /data/mysql/mysql-binlog"
alias mi="cd /data/mysql/mysql-data"
alias dp="cd /data/mysql/mysql-data"
 
## 환경 변수 적용
. ~/.bash_profile

MySQL Server 구동

1
2
3
4
5
cd /usr/local/mysql
## 기본 데이터베이스 설치
./scripts/mysql_install_db
## MySQL 데몬 Startup
/etc/init.d/mysqld start

MySQL 보안 설정

처음 DB를 올리면 보안 면에서 취약한 부분이 있습니다.
기본적인 보안 정책을 적용하도록 합니다.
mysql root  계정 패스워드만 설정하고 나머지는 Enter만 쭉 치면 됩니다.

1
2
cd /usr/local/mysql
./bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

이제 MySQL DB 설치가 다 끝났습니다. 참 쉽죠잉~!^^

.
:
Posted by .07274.
.. .. ..



MySQL 데이터베이스를 백업하거나 혹은 다른 머신 (Machine)으로 옮겨야 한다면,

다음과 같이 export할 수 있다.

mysqldump -uusername -ppassword database_name > dump.sql

테이블 (Table) 스키마 (Schema)와 데이터는 export되지만

import를 위해 계정과 데이터베이스는 다음과 같이 생성한다.

grant all privileges on database_name.* to 'username'@'localhost' identified by 'password';

create database database_name;

다음과 같이 import할 수 있다.

mysql -uusername -ppassword database_name < dump.sql

import가 완료되었음을 확인할 수 있다.


.
:
Posted by .07274.
2013. 10. 30. 22:43

J2EE 란? I.lib()/I.lib(Java)2013. 10. 30. 22:43

.. .. ..

http://cafe.naver.com/javakoreait/29

.
:
Posted by .07274.
2013. 9. 27. 16:42

Oracle LAG 사용 방법 I.lib()/I.lib(Oracle)2013. 9. 27. 16:42

.. .. ..

요약 :

 

LAG(컬럼1) OVER (ORDER BY 정렬컬럼1) 

 

     ===> 컬럼 1의 다음 Row 데이터

 

 

[출처] [Oracle] 오라클 LEAD, LAG|작성자 시어

 

전월대비 또는 전일대비 같은 Self Join 이나 Sum_Case 문을 사용하던것을

 

오라클 LAG 또는 LEAD 함수로 처리 한다.

 

이거쓰면 게시판의 이전 다음글을 좀 쉽게 구현할 수 있을까??

Lead 함수는 해당 파티션내의 바로 다음 Row 의 데이터를 참조할 수 있고

 

Lag 함수는 해당 파티션내의 바로 위의 Row 데이터를 참조할 수 있다.

 

 

SELECT

DAY

, MONEY

, ROUND( ( LAG(MONEY) OVER (ORDER BY DAY) - MONEY )/ MONEY *100 , 1) As BENEFIT_RATE
FROM

(
SELECT '20010901' As DAY, 1000 As MONEY FROM DUAL

UNION ALL
SELECT '20010902' As DAY, 990 As MONEY FROM DUAL

UNION ALL
SELECT '20010903' As DAY, 900 As MONEY FROM DUAL
);

결과는

DAY MONEY BENEFIT_RATE
20090901 1000
20090902 990 1
20090903 900 10

 

 

 

 

.
:
Posted by .07274.
.. .. ..

 

[펌 ] http://cafe.naver.com/anycallusershow/1803196

 

위 주소가 정리가 잘되있습니다^^

.
:
Posted by .07274.
.. .. ..

 

 

[펌] : http://www.jami.name/67

 

 

프로그래밍할 때 EditPlus http://www.editplus.com/ 를 사용하고 있었는데..
사용한지는 꽤 오래된 듯 싶다. 아직까지 칸단위 편집을 거의 사용하지 않고 있었다.
(사실 그런게 있는지 몰랐었다. -0-)

alt + c 후 선택

1. alt + c (편집 > 선택 > 칸단위선택) 하면 칸단위 선택이 된다. (이건 종종 사용했었는데..) 편집할 곳을 적당히 선택


채워질 문자

2. alt + e f f (편집 > 모양 > 선택부분채우기) 하면 선택한 부분에 삽입/대체 등을 할 수 있다. 물론 UltraEdit http://www.ultraedit.com/ , AcroEdit http://www.acrosoft.pe.kr/ 처럼 보면서 바로 칸단위 편집이 되지는 않지만 유용하게 사욯할 듯 싶다.


결과

3. 위와 같은 결과를 얻는다. :)
종종 사용하게 될 듯 싶다.

'I.lib() > I.lib(etc)' 카테고리의 다른 글

Nexus 설치후 초기 설정  (1) 2013.12.06
리눅스에서 아파치 설치 및 설정  (0) 2013.11.08
부산 여행 Tip  (0) 2013.08.09
PMD Rule Set 정리 [펌]  (0) 2013.07.30
겔럭시 s 부두 패치 경로  (0) 2013.04.19
.
:
Posted by .07274.