server 측 cmd 창에서 아래 실행.
mysql -u root -p
connect mysql
grant all privileges on mysql.* to cpn identified by 'cpn';
#--- 아래의 권한 설정 중 필요한 권한만 Y로 설정하여 부여 한다.
update user
set select_priv = 'Y',
insert_priv = 'Y',
update_priv = 'Y',
delete_priv = 'Y',
create_priv = 'Y',
drop_priv = 'Y',
reload_priv = 'Y',
shutdown_priv = 'Y',
process_priv = 'Y',
file_priv = 'Y',
grant_priv = 'Y',
references_priv = 'Y',
index_priv = 'Y',
alter_priv = 'Y',
show_db_priv = 'Y',
super_priv = 'Y',
create_tmp_table_priv = 'Y',
lock_tables_priv = 'Y',
execute_priv = 'Y',
repl_slave_priv = 'Y',
repl_client_priv = 'Y',
create_view_priv = 'Y',
show_view_priv = 'Y',
create_routine_priv = 'N',
alter_routine_priv = 'N',
create_user_priv = 'N'
where user = 'cpn';
commit;
flush privileges;
만약 권한이나 접속 IP 설정을 했다면 아래 문장을 실행하여야 한다.

{mysql_path}에서 mysqladmin -u root -p reload

이후 원격지에서는 설정한 권한으로 작업을 할 수 있다.

'DB > MySQL' 카테고리의 다른 글

Sample Database 다운로드  (0) 2012.11.06
InnoDB: No valid checkpoint found  (0) 2011.12.08
Fatal error: Can't open and lock privilege tables:  (0) 2011.12.08
접속 IP별 권한 설정.  (0) 2010.06.08
단순 다음에 기억이 안날까봐 여기에 적어 놓음.. ;;

형식 - UPDATE {TABLE} SET {COLUMN} FROM {SUB_QUERY} WHERE {CONDITION}

아래는 사용한 예..

UPDATE CUSTOMER_AUTO
SET   CUSTOMER_AUTO.WARRANTY_EXPIRED_DATE = dateadd(day, -1, dateadd(month, RTL.PERIOD_1, CUSTOMER_AUTO.REGIST_DATE))
    , CUSTOMER_AUTO.SERVICE_EXPIRED_DATE = dateadd(day, -1, dateadd(month, RTL.PERIOD_2, CUSTOMER_AUTO.REGIST_DATE))
FROM (
    SELECT A.COMM_NO
        , CASE WHEN A.DELIVERY_PRICE_SEQ = 'CS0001' THEN C.WARRANTY_PERIOD_GENERAL
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0002' THEN C.WARRANTY_PERIOD_TAX_FREE
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0003' THEN C.WARRANTY_PERIOD_DIPLOMAT
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0006' THEN C.WARRANTY_PERIOD_RENT
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0005' OR A.DELIVERY_PRICE_SEQ = 'CS0004' THEN 36
              ELSE 0 END
        AS PERIOD_1
        , CASE WHEN A.DELIVERY_PRICE_SEQ = 'CS0001' THEN C.WITHOUT_COST_PERIOD_GENERAL
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0002' THEN C.WITHOUT_COST_PERIOD_TAX_FREE
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0003' THEN C.WITHOUT_COST_PERIOD_DIPLOMAT
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0006' THEN C.WITHOUT_COST_PERIOD_RENT
              WHEN A.DELIVERY_PRICE_SEQ = 'CS0005' OR A.DELIVERY_PRICE_SEQ = 'CS0004' THEN 36
              ELSE 0 END
        AS PERIOD_2
    FROM SALE_CONFER A
    INNER JOIN CUSTOMER_AUTO D ON A.COMM_NO = D.COMM_NO AND D.REGIST_DATE IS NOT NULL AND (D.WARRANTY_EXPIRED_DATE IS NULL OR D.SERVICE_EXPIRED_DATE IS NULL)
    INNER JOIN STOCK B ON A.COMM_NO = B.COMM_NO
    INNER JOIN AUTO_YEARS C ON A.AUTO_MODEL = C.AUTO_MODEL AND B.YEAR_SEQ = C.YEAR_SEQ
    WHERE A.DELIVERY_PRICE_SEQ IS NOT NULL AND A.COMM_NO IS NOT NULL AND A.SALE_FIXED_DATE >= {ts '2010-05-17 00:00:00'}
) RTL
WHERE CUSTOMER_AUTO.COMM_NO = RTL.COMM_NO AND REGIST_DATE IS NOT NULL AND (WARRANTY_EXPIRED_DATE IS NULL OR SERVICE_EXPIRED_DATE IS NULL) AND CUSTOMER_AUTO.COMM_NO IS NOT NULL


'DB > MSSQL' 카테고리의 다른 글

SELECT 후 UPDATE  (0) 2010.06.08
MS-SQL JDBC Library  (0) 2009.12.09

Ubuntu에 subversion을 잘 설치해서 쓰다가.. svn+ssh가 안되어서 날려버렸다.. ;;

그래서 다 지우고 다시 설치하였는데.. 또 날리면 개고생할까봐.. 일단.. 적어놓는다..

apt-get remove subversion

apt-get install subversion

저장소 폴더 생성 -
mkdir /{your_path}/svn/

sudo groupadd {your_group}
sudo usermod -a -G {your_group} {your_account}

project 생성
cd {your_path}/svn/
sudo mkdir {project_name}
sudo chown -R {your_account}:{your_group} {project_name}
sudo chmod -R g+rws {project_name}

저장소 생성
sudo svnadmin create --fs-type fsfs /home/svn/{project_name}
cd /home/svn/{project_name}

svnserve -d -r /home/svn

ssh key 생성
ssh-keygen -b 1024 -N {password} -f {keyName}
cp {keyName.pub} ~/.ssh/authorized_keys

password / auth 설정

TEST
svn mkdir -m 'Created Test' --username yeory svn://localhost:3690/{project_name}/trunk
svn mkdir -m 'Created Test' --username yeory svn://localhost:3690/{project_name}/tags
svn mkdir -m 'Created Test' --username yeory svn://localhost:3690/{project_name}/brunch
svn rm -m 'Deleted Test directory' svn://localhost:3690/{project_name}/{folder_name}

확인
svn ls svn://localhost:3690/{project_name}/

+ Recent posts