프로그램 사용/wiki2017. 1. 16. 13:17

깨끗한 모습은 아래와 같고..

page_id

Uniquely identifying primary key. This value is preserved across edits, renames, and, as of MediaWiki 1.27, deletions, via an analogous field in the archive table (introduced in MediaWiki 1.11). For example, for this page, page_id = 10501. [1][2] This field can be accessed by WikiPage::getId(), Title::getArticleID(), etc.


page_latest

This is a foreign key to rev_id for the current revision. It may be 0 during page creation. It needs to link to a revision with a valid revision.rev_page, or there will be the "The revision #0 of the page named 'Foo' does not exist" error when one tries to view the page. Can be obtained via WikiPage::getLatest(). 

[링크 : https://www.mediawiki.org/wiki/Manual:Page_table]


rev_id

This field holds the primary key for each revision. page_latest is a foreign key to this field.


rev_page

This field holds a reference to the page to which this revision pertains. The number in this field is equal to the page_id field of said page. This should never be invalid; if it is, that revision won't show up in the page history. If page.page_latest links to a revision with an invalid rev_page, this will cause the "The revision #0 of the page named 'Foo' does not exist" error.


rev_text_id

This is a foreign key to old_id in the text table. (The text table is where the actual bulk text is stored.) It's possible for multiple revisions to use the same text—for instance, revisions where only metadata is altered, or where a rollback is done to a previous version. 

[링크 : https://www.mediawiki.org/wiki/Manual:Revision_table]


The text table holds the wikitext of individual page revisions. If using Postgres or Oracle, this table is named pagecontent. 

[링크 : https://www.mediawiki.org/wiki/Manual:Text_table]


낙서를 좀 하면 아래와 같아지나?

page가 주제어에 따른 고유 id로 revision으로 page의 revision을 관리

revision에서는 text와 연결되어 revision 별로 관리 하는데..

그렇다면 page별 리비전은 

revision에서 rev_page값을 page의 page_id를 이용하여 검색하면 될거 같긴하네

내용 자체는 revision의 rev_text_id를 통해 text.old_id를 하면 될 거 같고


[링크 : https://www.mediawiki.org/wiki/Manual:Database_layout]

    [링크 : https://upload.wikimedia.org/wikipedia/commons/9/94/MediaWiki_1.28.0_database_schema.svg]



+

운영중인 위키에서 내용 본건데..

page 의 page_id와 page_latest

revision 의 rev_page와 rev_text_id

text 의 old_id


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

mediawiki upgrade 1.19(LTS) to ???  (0) 2018.04.20
mediawiki sql debug dump  (0) 2017.06.16
mediawiki 다국어 확장 및 번역 확장  (0) 2017.01.10
mediawiki 1.28.0과 Xcache  (0) 2017.01.09
mediawiki extension - deletehistory  (0) 2015.11.04
Posted by 구차니

aes랑 des는 phpmyadmin에서 안되서 좀더 찾아 봐야 할 듯..


입력 1234

password() *A4B6157319038724E3560894F7F932C8886EBFCF

encrypt() 36QYTDVIT3tfU

md5() 81dc9bdb52d04dc20036dbd8313ed055

sha1() 7110eda4d09e062aa5e4a390b0a572ac0d2c0220


별다른 옵션 안주고 실행한것임. 길이를 보면 대충 보일려나?


그나저나.. brcypt 이런건 함수가 안보이네..

+

bcrypt mcrypt는 php쪽 이니까 있을리가!?


5.7 부터 은근 deprecate 된 함수들이 꽤 있네..

[링크 : http://dev.mysql.com/doc/refman/5.7/en/encryption-functions.html]

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

mysql event (schedule)  (0) 2017.02.05
mysql 테이블 내 일정 문자열 치환하기  (0) 2017.01.26
mysql prepare + execute 와 query 차이점  (0) 2017.01.15
mysql mariadb 호환성  (0) 2017.01.12
mysql 트랜잭션  (0) 2017.01.12
Posted by 구차니

php에서 PDO를 통해

prepare / execute / fetch를 통해 수행하는 것과

query / fetch를 하는게 있길래 찾아보니..


얘는 엄밀하게 mysql의 지원기능이라고 해야 하려나?

mysql> SET @s = 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';

mysql> PREPARE stmt2 FROM @s;

mysql> SET @a = 6;

mysql> SET @b = 8;

mysql> EXECUTE stmt2 USING @a, @b;

+------------+

| hypotenuse |

+------------+

|         10 |

+------------+

mysql> DEALLOCATE PREPARE stmt2; 

[링크 : https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html]


prepare는 mysql 내부에서 치환을 통해 어떠한 수행을 할 수 있는 일종의 매크로 같은 개념으로

확장해서 사용할 수 있도록 하는 건데..


성능상의 차이가 없다면.. php에서 query문을 직접 변수 치환해서 하는게 편할수도 있을테니

어느게 좋고 어느게 나쁘다 라고 하긴 애매 할 듯.

관리적인 측면에서는 쿼리문을 쫘악 정리하고 변수 치환만 해서 쓰도록

php에서 변수 대입을 하던 mysql 에서 prepare로 하던 똑같으니까?


[링크 : http://www.codeigniter-kr.org/bbs/view/qna?idx=9891]

[링크 : http://stackoverflow.com/questions/4700623/pdos-query-vs-execute]


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

mysql 테이블 내 일정 문자열 치환하기  (0) 2017.01.26
mysql 암호화 방법들...?  (0) 2017.01.16
mysql mariadb 호환성  (0) 2017.01.12
mysql 트랜잭션  (0) 2017.01.12
mysql blob - binary large object  (0) 2017.01.12
Posted by 구차니

머.. 공식 사이트 도움말이니 맞겠지?

일단은 5.1 끼리는 바이너리 레벨에서 호환되지만

환경설정파일에 [mysql]을 [mariadb] 로는 수정을 해야 한다 정도?


[링크 : https://mariadb.com/kb/ko/mariadb-mysql/]

[링크 : https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/]

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

mysql 암호화 방법들...?  (0) 2017.01.16
mysql prepare + execute 와 query 차이점  (0) 2017.01.15
mysql 트랜잭션  (0) 2017.01.12
mysql blob - binary large object  (0) 2017.01.12
mysql 변수별 사이즈  (0) 2017.01.12
Posted by 구차니

innodb에서 적용가능(MyISAM은 적용 불가)


query로 처리

랩핑된 함수는 없는 듯?

[링크 : http://php.net/manual/en/ref.mysql.php]

[링크 : http://stackoverflow.com/questions/2708237/php-mysql-transactions-examples]

[링크 : http://recoveryman.tistory.com/187]


mysqli 클래스 에도 지원은 하네

[링크 : http://php.net/manual/en/book.mysqli.php]

[링크 : http://php.net/manual/en/mysqli.begin-transaction.php]

[링크 : http://php.net/manual/en/mysqli.commit.php]

[링크 : http://php.net/manual/en/mysqli.rollback.php]


다만 PDO를 통하면 클래스 메소드로 지원을 하도록 랩핑한 듯?

[링크 : http://php.net/manual/en/book.pdo.php]

[링크 : http://php.net/manual/en/pdo.begintransaction.php]

[링크 : http://php.net/manual/en/pdo.commit.php]

[링크 : http://php.net/manual/en/pdo.rollback.php]

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

mysql prepare + execute 와 query 차이점  (0) 2017.01.15
mysql mariadb 호환성  (0) 2017.01.12
mysql blob - binary large object  (0) 2017.01.12
mysql 변수별 사이즈  (0) 2017.01.12
mysql 다대다 관계  (0) 2017.01.04
Posted by 구차니

BLOB은 Binary Large OBject의 약자인데

[링크 : http://dev.mysql.com/doc/refman/5.7/en/blob.html]


mediawiki 구조를 보는데 희한하리만치 blob을 많이써서 찾아보는데

이미지까지도 blob으로 관리한다는 나름 근래글들...



그래도 대용량일 경우 disk io많이먹으니 데이블 분리를 추천

[링크 : http://stackoverflow.com/.../speed-of-mysql-query-on-tables-containing-blob-depends-on-filesystem-cache]

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

mysql mariadb 호환성  (0) 2017.01.12
mysql 트랜잭션  (0) 2017.01.12
mysql 변수별 사이즈  (0) 2017.01.12
mysql 다대다 관계  (0) 2017.01.04
mysql 인덱스와 db설계 실무 팁(?)  (0) 2017.01.04
Posted by 구차니

mediawiki에 BLOB 말고

MEDIUMBLOB 이라는게 있어서 용량을 찾아 보니.. 2^24?

2^24 = 16777216 = 16MB

위키 문서 길이 치고는 너무 긴거 아닌가 싶기도 하고?


[링크 : http://dev.mysql.com/doc/refman/5.5/en/storage-requirements.html]

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

mysql 트랜잭션  (0) 2017.01.12
mysql blob - binary large object  (0) 2017.01.12
mysql 다대다 관계  (0) 2017.01.04
mysql 인덱스와 db설계 실무 팁(?)  (0) 2017.01.04
mysql datetime과 timestamp 차이점  (0) 2017.01.04
Posted by 구차니
프로그램 사용/apache2017. 1. 10. 13:55

mod_throttle은 대충 찾아 보니 Apache 1.x 꺼고

mod_cband는 apache 2.x 용인듯


그래서 대세(!?)는 mod_cband


[링크 : https://sourceforge.net/projects/cband/]

[링크 : http://serverfault.com/questions/30149/alternative-to-mod-throttle]

Posted by 구차니
프로그램 사용/wiki2017. 1. 10. 10:04

다국어 하면서 먼가 db 쪽 변화가 큰가 보네..


[링크 : https://www.mediawiki.org/wiki/Multilingual_MediaWiki]

[링크 : https://www.mediawiki.org/wiki/Extension:Translate]

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

mediawiki sql debug dump  (0) 2017.06.16
mediawiki 데이터 구조 - page / revision  (0) 2017.01.16
mediawiki 1.28.0과 Xcache  (0) 2017.01.09
mediawiki extension - deletehistory  (0) 2015.11.04
google Analystics extension  (0) 2015.06.25
Posted by 구차니
프로그램 사용/wiki2017. 1. 9. 14:55

미디어위키 db구조 보려고 하는데

어라 설치중이라 로고가 다른가? ㅋ


아무튼 설치하려는데 개체 캐싱을 활성화 못하다는 에러와

유니코드 정규화 어쩌구 하길래 삽질을 해보니

두개 패키지를 설치하면 되는 듯 하다.

$ sudo apt-get install xcache php5-intl  



+

Xcache의 영향인가..


LocalSetting.php 에서 CACHE_ACCEL을 CACHE_ANYTHING로 바꾸어주면 로그인은 된다..

다만, 로그인 이미되어 있다고 이상 작동을 할뿐?

 69 ## Shared memory settings

 70 #$wgMainCacheType = CACHE_ACCEL;

 71 $wgMainCacheType = CACHE_ANYTHING;

 72 $wgMemCachedServers = [];

[링크 : https://www.mediawiki.org/wiki/Manual:$wgSessionCacheType]

  [링크 : http://stackoverflow.com/.../cant-log-in-to-mediawiki-canceled-as-a-precaution-against-session-hijacking]


+ 테이블 전부가 UTF-8 encoding이라는데. 그거 영향인가?

[링크 : https://www.mediawiki.org/wiki/Manual:$wgDBmysql5]


일단 테이블 자체는 binary 정렬방식이고 user_name은 varbinary(255)


user_name은.. 16진수로 써있지만 Minimonk 로 첫자가 대문자로 입력되어 있다.


---

$ sudo apt-cache search xcache

php-horde-cache - Horde Caching API

php5-xcache - Fast, stable PHP opcode cacher 


$ sudo apt-get install php5-intl 

[링크 : https://ibeblog.com/2013/01/21/installing-pecl-intl-ubuntu-12-04/]


$ sudo apt-cache search pecl | grep -i pecl

dh-make-php - Creates Debian source packages for PHP PEAR and PECL extensions

dh-php5 - debhelper add-on to handle PHP PECL extensions

libghc-byteable-dev - typeclass for byte sequences

libghc-byteable-doc - typeclass for byte sequences; documentation

libghc-byteable-prof - typeclass for byte sequences; profiling libraries

libghc-chunked-data-dev - typeclasses for dealing with various chunked data representations

libghc-chunked-data-doc - typeclasses for dealing with various chunked data representations; documentation

libghc-chunked-data-prof - typeclasses for dealing with various chunked data representations; profiling libraries

libghc-classy-prelude-dev - typeclass-based prelude

libghc-classy-prelude-doc - typeclass-based prelude; documentation

libghc-classy-prelude-prof - typeclass-based prelude; profiling libraries

libghc-convertible-dev - Typeclasses and instances for converting between types, GHC package

libghc-convertible-doc - Typeclasses and instances for converting between types, documentation

libghc-convertible-prof - Typeclasses and instances for converting between types, GHC profiling package

libghc-convertible-text-doc - typeclasses and instances for converting between types; documentation

libghc-mono-traversable-dev - typeclasses for mapping/folding/traversing monomorphic containers

libghc-mono-traversable-doc - typeclasses for mapping/folding/traversing monomorphic containers; documentation

libghc-mono-traversable-prof - typeclasses for mapping/folding/traversing monomorphic containers; profiling libraries

libghc-newtype-dev - A typeclass for working with newtypes

libghc-newtype-doc - A typeclass for working with newtypes; documentation

libghc-newtype-prof - A typeclass for working with newtypes; profiling libraries

libtarantool-php - PECL PHP driver for Tarantool/Box

php5-pecl-http - pecl_http module for PHP 5 Extended HTTP Support

php5-pecl-http-dev - pecl_http module for PHP 5 Extended HTTP Support development headers

php5-radius - PECL radius module for PHP 5

php5-remctl - PECL module for Kerberos-authenticated command execution 


$ sudo apt-get install php5-pecl-http php5-xcache

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  php-pear php5-propro php5-raphf

Suggested packages:

  php5-dev

The following NEW packages will be installed:

  php-pear php5-pecl-http php5-propro php5-raphf php5-xcache

0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.

Need to get 486 kB of archives.

After this operation, 2,712 kB of additional disk space will be used.

Do you want to continue? [Y/n] 


[링크 : https://www.liquidweb.com/kb/how-to-install-xcache-on-ubuntu-14-04-lts/]

Posted by 구차니