생성하니 이렇게 뷰라고 따로 생기는데

보는건

select * from organization;

으로 그냥 테이블 보는 느낌으로 하게 된다.


일단은.. join을 써서 만들었는데, idx 값이 양쪽에서 다 와서 합쳐지다 보니

그런 중복 항목에 대해서 이름을 바꾸어 주거나, 제외해주어야지 뷰가 생성된다.



[링크 : https://dev.mysql.com/doc/refman/5.7/en/create-view.html]

Posted by 구차니

wiki 식으로 리비전을 계속 올리면서 저장을 하게 되면...

고민을 해보니 대용량의 경우 엄청나게 용량을 쳐묵쳐묵 하게 되는데

(wiki 페이지 하나가 400kb 넘어가는데 그걸 하루 한번 1년 한다고 하면..)

내용 자체를 compress 해서 넣고 decompress 해서 사용하면 조금 느려도 괜찮으려나 싶었지만

sql 문을 통해 검색이 안될거 같아서 포기..


그러다가 찾은게.. db 자체를 압축하는 건데

라즈베리 버전에서는 활성화가 안되어있는지 안뜬다.

COMPACT랑 REDUNDANT만 뜨는 상태..


[링크 : http://stackoverflow.com/questions/8228950/compressing-text-before-storing-it-in-the-database]


[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-row-format-dynamic.html]

[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-row-format-antelope.html]


+

phpmyadmin 에서 sql을 통해 실행해도 나온다.



SET GLOBAL innodb_file_per_table=1;

SET GLOBAL innodb_file_format=Barracuda; 

[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-compression-usage.html]


기본값은 antelope 이고 barracuda는 신규 포맷


[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format.html]

'프로그램 사용 > mysql & mariaDB' 카테고리의 다른 글

db varchar 와 char  (0) 2017.05.09
db에 mac / ip 저장하기(자료형)  (0) 2017.05.09
mysql view  (0) 2017.03.14
db designer  (0) 2017.03.14
데이터베이스 구조 버전관리  (0) 2017.02.13
Posted by 구차니
프로그램 사용/apache2017. 4. 12. 09:43

에러로그 설정하고 보는데 먼소리인지 모르겠다 ㅠㅠ

일단 규칙은 아래와 같이 들어온 주소를 index.php?url="어쩌구" 식으로 바꾸어 주는건데

문제는 ^(.+)$ ...

처음부터 끝까지 내용이 없던 머던 상관없는데 이걸 $1로 치환하라 인데

Options -MultiViews

RewriteEngine On

Options -Indexes

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 


현재 읽혀 있는 경로에서 달라지는 내용만을 적용대상으로 삼는건가?

/var/www/html/arch/test/index.php 에서 있는 파일은 웹상으로 접속하면

http://localhost/arch/test 인데, 이 파일에서 링크된 다른 경로

arch/test/board는 이전 주소를 기본으로 볼때 board가 하나 추가 된 셈이니

test 이후의 board만 들어가서 rewrite rule에 적용을 받는건가?

 [perdir /var/www/html/arch/test/] add path info postfix: /var/www/html/arch/test/board -> /var/www/html/arch/test/board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/board/ -> board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'board/', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] rewrite 'board/' -> 'index.php?url=board/', referer: http://localhost/arch/test/board/

 split uri=index.php?url=board/ -> uri=index.php, args=url=board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] add per-dir prefix: index.php -> /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip document_root prefix: /var/www/html/arch/test/index.php -> /arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] internal redirect with /arch/test/index.php [INTERNAL REDIRECT], referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/index.php -> index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'index.php', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/public/css/style.css -> public/css/style.css, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'public/css/style.css', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/public/css/style.css, referer: http://localhost/arch/test/board/ 


[링크 : http://webskills.kr/archives/515]


+

QSA는 Cond를 지난 결과에 덧 붙인다라는 의미..

음.. 경로의 마법은 저 Cond와 QSA인가?

[링크 : http://soul0.tistory.com/208]


+

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request, if this has already been determined by the server at the time REQUEST_FILENAME is referenced. Otherwise, such as when used in virtual host context, the same value as REQUEST_URI. Depending on the value of AcceptPathInfo, the server may have only used some leading components of the REQUEST_URI to map the request to a file.


REQUEST_URI

The path component of the requested URI, such as "/index.html". This notably excludes the query string which is available as its own variable named QUERY_STRING.

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


Filename should give you the complete local path, where request uri will be exactly what was requested (should also include the GET parameters). From the manual:

REQUEST_URI

The resource requested in the HTTP request line. (In the example above, this would be "/index.html".)

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request. 

[링크 : http://www.miva.com/...-htaccess-what-s-the-difference-between-request_filename-and-request_uri]

Posted by 구차니
프로그램 사용/apache2017. 4. 12. 09:30

테스트를 해보니.. apache 전역 환경설정에서 해야 하고

로컬 .htaccess에 설정하면 에러가 발생한다.

[Wed Apr 12 09:14:03.530865 2017] [core:alert] [pid 30981] [client 0.0.0.0:3628] /var/www/html/arch/test/.htaccess: LogLevel not allowed here 


아파치 2.4 이후

LogLevel alert rewrite:trace3

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


아파치 2.2 이전

RewriteEngine on

RewriteLog /path/to/log

RewriteLogLevel 5 

[링크 : https://wiki.apache.org/httpd/RewriteLog]



그나저나 한 페이지 로딩할때 이미지나 css 등 개별파일들 전부 적용되서 로그가 남는구나 ㄷㄷ

Posted by 구차니
프로그램 사용/apache2017. 4. 11. 19:54

기본값으로는 해당 모듈이 활성화 되어 있지 않았네...


$ cd /etc/apache2/mods-enabled

$ sudo ln -s ../mods-available/rewrite.load rewrite.load 




+

Directory 항목중 AllowOverride all 를 해주지 않으면

파일로 저장된 .htaccess를 적용되지 않는 것으로 보인다.

[링크 : http://zetawiki.com/wiki/하위폴더_.htaccess_설정]

'프로그램 사용 > apache' 카테고리의 다른 글

mod_rewrite 테스트..  (4) 2017.04.12
mod_rewrite 로그설정  (0) 2017.04.12
mod_rewrite 설정 및 정규표현식  (0) 2017.04.10
apache mod_deflast mod_gzip  (0) 2017.01.23
무료 ssl 인증서 - lets encrypt  (2) 2017.01.20
Posted by 구차니
프로그램 사용/apache2017. 4. 10. 15:31
일단 UI 상으로 바로 할순 없고
쿼리문을 통해서 보고 나서

그걸 이용해서 view로 생하는 시나리오 인듯?




[링크 : http://stackoverflow.com/questions/2279240/how-can-i-edit-a-view-using-phpmyadmin-3-2-4]

[링크 : http://stackoverflow.com/questions/40306725/create-view-in-phpmyadmin]

Posted by 구차니
프로그램 사용/gcc2017. 4. 4. 21:00

GCC G++ 공식문서를 찾지 못했는데

아무튼.. wchar_t 로 wide character형이 추가된것 외에는 차이가 없는듯

kldp 쪽을 봐도 gcc에서는 UTF-32 4byte 로 된다는 정도만 있는것 봐서는

MSVC에 비해 유니코드 대응이 미진하긴 미진 한 듯.


wchar_t

type for wide character representation (see wide strings). Required to be large enough to represent any supported character code point (32 bits on systems that support Unicode. A notable exception is Windows, where wchar_t is 16 bits and holds UTF-16 code units) It has the same size, signedness, and alignment as one of the integral types, but is a distinct type.


[링크 : http://en.cppreference.com/w/cpp/language/types]

[링크 : http://en.cppreference.com/w/cpp/keyword]

'프로그램 사용 > gcc' 카테고리의 다른 글

gcc variadic macro  (0) 2017.06.20
문자열에 escape 로 특수문자 넣기  (0) 2017.06.19
gcc 매크로 확장 define stringfication  (0) 2017.01.02
gcc make CFLAGS=-D 관련  (0) 2016.11.17
gcc -fPIC  (0) 2016.06.22
Posted by 구차니

ansi sql을 지원할줄 알았는데 그게 아니었나..

. 으로 시작하는 명령어들로 구성되어 있네


sqlite> .help

.backup ?DB? FILE      Backup DB (default "main") to FILE

.bail on|off           Stop after hitting an error.  Default OFF

.clone NEWDB           Clone data into NEWDB from the existing database

.databases             List names and files of attached databases

.dump ?TABLE? ...      Dump the database in an SQL text format

                         If TABLE specified, only dump tables matching

                         LIKE pattern TABLE.

.echo on|off           Turn command echo on or off

.eqp on|off            Enable or disable automatic EXPLAIN QUERY PLAN

.exit                  Exit this program

.explain ?on|off?      Turn output mode suitable for EXPLAIN on or off.

                         With no args, it turns EXPLAIN on.

.fullschema            Show schema and the content of sqlite_stat tables

.headers on|off        Turn display of headers on or off

.help                  Show this message

.import FILE TABLE     Import data from FILE into TABLE

.indices ?TABLE?       Show names of all indices

                         If TABLE specified, only show indices for tables

                         matching LIKE pattern TABLE.

.load FILE ?ENTRY?     Load an extension library

.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout

.mode MODE ?TABLE?     Set output mode where MODE is one of:

                         csv      Comma-separated values

                         column   Left-aligned columns.  (See .width)

                         html     HTML <table> code

                         insert   SQL insert statements for TABLE

                         line     One value per line

                         list     Values delimited by .separator string

                         tabs     Tab-separated values

                         tcl      TCL list elements

.nullvalue STRING      Use STRING in place of NULL values

.once FILENAME         Output for the next SQL command only to FILENAME

.open ?FILENAME?       Close existing database and reopen FILENAME

.output ?FILENAME?     Send output to FILENAME or stdout

.print STRING...       Print literal STRING

.prompt MAIN CONTINUE  Replace the standard prompts

.quit                  Exit this program

.read FILENAME         Execute SQL in FILENAME

.restore ?DB? FILE     Restore content of DB (default "main") from FILE

.save FILE             Write in-memory database into FILE

.schema ?TABLE?        Show the CREATE statements

                         If TABLE specified, only show tables matching

                         LIKE pattern TABLE.

.separator STRING ?NL? Change separator used by output mode and .import

                         NL is the end-of-line mark for CSV

.shell CMD ARGS...     Run CMD ARGS... in a system shell

.show                  Show the current values for various settings

.stats on|off          Turn stats on or off

.system CMD ARGS...    Run CMD ARGS... in a system shell

.tables ?TABLE?        List names of tables

                         If TABLE specified, only list tables matching

                         LIKE pattern TABLE.

.timeout MS            Try opening locked tables for MS milliseconds

.timer on|off          Turn SQL timer on or off

.trace FILE|off        Output each SQL statement as it is run

.vfsname ?AUX?         Print the name of the VFS stack

.width NUM1 NUM2 ...   Set column widths for "column" mode

                         Negative values right-justify 


sql 명령은 그냥 직접 치면 된다.

[링크 : http://blog.simplism.kr/?p=2329]

'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
라즈베리 sqlite 버전  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니

sqlite 2.8은 당연하지만(!) 3.x 대의 파일을 열수 없다.

$ sqlite -version

2.8.17


$ sqlite3 -version

3.8.7.1 2014-10-29 13:59:56 3b7b72c4685aa5cf5e675c2c47ebec10d9704221 


sqlite 3.x 대의 db를 열려고 하니 에러가 발생! ㅠㅠ

$ file *

sqlite.udb: SQLite 3.x database 


$ sqlite sqlite.udb

Unable to open database "sqlite.udb": file is encrypted or is not a database


'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
sqlite3 도움말  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니