Go to the first, previous, next, last section, table of contents.


1 General Information About MySQL

これは MySQL のリファレンスマニュアルです; これは MySQL バージョン 3.23.49 について記述しています。

MySQL は発展中なので、マニュアルは頻繁に更新されます。そのため、 オンラインで参照しない限り、このバージョンが期限切れである可能性があります。 このマニュアルの最新バージョンは http://www.mysql.com/documentation/ に多 様な形式で置いてあります。マニュアル内の情報を見つけるつらい時間を持つなら、 検索可能 PHP バージョン http://www.mysql.com/documentation/manual.php を試す ことが可能です。

MySQL はとても高速で、マルチスレッド、マルチユーザの、頑丈な SQL (Structured Query Language)データベースサーバです。

MySQL はフリーソフトウェアです。GNU GENERAL PUBLIC LICENSE http://www.gnu.org/ でライセンスされています。 「1.3 MySQL ライセンスとサポート」節参照.

MySQL ホームページMySQL についての最新情報を提供しています。

次のリストはマニュアルのいくつかの有用なセクションを説明しています:

重要:

エラー(バグ)レポート、質問、コメントは メーリングリスト mysql@lists.mysql.com に送ってください。 「1.2.22.3 バグや問題を報告する方法」節参照。 バグレポートを生成するためには mysqlbug スクリプトを使用すべきです。 ソースディストリビューションでは、mysqlbug スクリプトは `scripts' ディレクトリ に見つけることができます。バイナリディストリビューションでは、mysqlbug`bin' ディレクトリに見つけることができます。 MySQL のセキュリティバグを発見した場合は、 security@mysql.com に email を送ってください。

このマニュアルへの追加または修正に関連する提案がある場合は、それらを MySQL マニュアルチーム docs@mysql.com に 送ってください。

これはリファレンスマニュアルです。一般的な SQL やリレーショナルデータベー ス概念の説明書ではありません。SQL についての一般的な情報を得たければ、 「1.2.2 一般的な SQL 情報とチュートリアル」節 を見てください。特に MySQL に焦点をあてた本につ いては、 「1.2.1 MySQL 関連の書籍」節 を見てください。

1.1 MySQL, MySQL AB, and Open Source

1.1.1 What Is MySQL

MySQLは、もっとも有名なオープンソースSQLデータベースで、 MySQL AB によって供給されています。MySQL ABMySQL データベースのまわりのサービスを提供するビジネスを構築する 営利会社です。 「1.1.2 What Is MySQL AB」節参照.

MySQL はデータベース管理システムです。
データベースはデータの集まりで構成されています。絵画のギャラリーの単純な ショッピングリストや共通ネットワーク内での膨大な量の情報からもなり得ます。 コンピュータデータベースに格納されたデータの追加、アクセス、処理のために は、MySQL のようなデータベース管理システムが必要です。コンピュー タは大量のデータの処理にとても向いているので、データベース管理システムは スタンドアロンユーティリティや他のアプリケーションの一部として、コンピュー タの中で中心的な役割を演じています。
MySQL は関係データベース管理システムです。
関係データベースはデータを大きな格納場所に全てのデータを置くのではなく、 別々のテーブル内に格納します。これは速度と柔軟性を追加します。要求された いくつかのテーブルからデータを結合することを可能とする関係を定義すること により、テーブルがリンクされます。MySQL の SQL 部分は "構造化ク エリ言語 (Structured Query Language)" を表しています。これは、データベー スのアクセスに使用される最も有名な標準言語です。
MySQL はオープンソースソフトウェアです。
オープンソースの意味は誰でも使用し変更することができるということです。誰 でも MySQL をインターネットからダウンロードし、何も支払わずに使 用することができます。その気があれば誰でも必要に応じてソースコードを調べ、 変更することができます。MySQL は GPL (GNU General Public License) http://www.gnu.org を使用します。これは、様々な状況でそ のソフトウェアで行なえることと行なえないことを定義しています。もし GPL を嫌だと感じていたり、MySQL を商用アプリケーションに組み込む必 要があるなら、商用ライセンス版を我々から購入することができます。
何故 MySQL を使用するのか?
MySQL はとても速く、信頼でき、簡単に使用できます。それがあなた が探しているものなら、試してみるべきです。MySQL は、我々のユー ザと協力して開発されたとても実用的な機能のセットを持っています。我々のベ ンチマークページ上で、MySQL と他のいくつかのデータベース管理シ ステムの性能比較を見つけることができます。 「5.1.4 The MySQL Benchmark Suite」節参照. MySQL は、既存のソリューションよりも速くとても大きなデータベー スを処理するために、そして、高い需要がある製品環境で何年間かの使用に耐え るために、独創的に開発されました。一定の開発下で、MySQL は今日、 豊富でとても有用な機能セットを提供します。MySQL は、結合性、速 度、セキュリティでインターネット上でのデータベースアクセスに高く適合しま す。
MySQL の技術機能。
詳しい技術情報については、 「6 MySQL Language Reference」節。MySQL は、様々なバッ クエンドをサポートするマルチスレッド SQL サーバ、いくつかのクライアント プログラム、ライブラリ、管理ツール、プログラミングインタフェースから成る クライアント/サーバシステムです。
MySQL は多くの貢献ソフトを持っています。
おそらく、すでに MySQL をサポートする、あなたの好きなアプリケー ション/言語を見つけることができるでしょう。

MySQL の公式な発音は ``My Ess Que Ell'' です(MY-SEQUEL ではあり ません)。 しかし MY-SEQUEL と発音する人を正すことは避けています。

1.1.2 What Is MySQL AB

MySQL AB は、MySQL の創始者と主な開発者によって所有され、 運営されているスウェーデンの会社です。我々は、MySQL の開発と我々 のデータベースを新しいユーザに広げることに専念しています。MySQL ABMySQL サーバソースコードの著作権と MySQL 商標を所 有します。我々のサービスからの重要な収益の総量は MySQL の開発に向 けられます。 「1.1.1 What Is MySQL」節参照.

MySQL AB has been profitable providing MySQL from the start. We don't get any outside funding, but have earned all our money ourselves.

私たちはMySQLの開発ペースをより良いものにするために、開発に協力して下さるパートナーを求めています。 もしあなたがこの仕事に興味を持って下さるなら、partner@mysql.comまで御連絡下さい。

現在MySQL AB には20人以上のスタッフ (http://www.mysql.com/development/team.html)を有しており、採用と成長のペースは急速なものです。

MySQL AB has currently 20+ people (http://www.mysql.com/development/team.html) on its payroll and is growing rapidly.

Our main sources of income are:

The MySQL core values show our dedication to MySQL and Open Source.

我々は MySQL を次のようにしたいです。

MySQL ABMySQL AB の人々は次を行ないます。

1.1.3 このマニュアルについて

このマニュアルは以下の方々により訳されました (ハンドル名だけ書きます。敬称略。翻訳サーバーに登録した順 :) ):

このマニュアルは現在 Texinfo, プレーンテキスト, Info, HTML, PostScript, PDF バージョンがあります。 プライマリドキュメントは Texinfo ファイルです。HTML バージョンは texi2html の変更されたバージョンで自動的に提供されます。プレーン テキストと Info バージョンは makeinfo で提供されます。PostScript バージョンは texi2dvidivps を使用して提供されます。PDF バージョンは pdftex で提供されます。

このマニュアルは David Axmark, Michael (Monty) Widenius, Jeremy Cole, Paul DuBois, によって作成され、維持されています。他の貢献者については 「E Credits」節 を参照してください。

1.1.4 このマニュアル中で使用されている表記

このマニュアルは特定の印刷上の表記を使用しています:

constant
固定幅フォントは次のものに使用されます。コマンド名, オプション; SQL ステー トメント; データベース名, テーブル名, フィールド名; C と Perl コード; 環境変数。 例: ``mysqladmin がどのように動作するかを見るためには、 --help オプションをつけて起動してください。''
`filename'
引用符で括られた固定幅フォントはファイル名とパス名に使用されます。例: `` ディストリビューションは `/usr/local' ディレクトリ配下にインストールされます。''
`c'
引用符で括られた固定幅フォントは文字シーケンスを示すためにも使用されます。 例: ``ワイルドカードを指定するためには、`%' 文字を使用してください。''
italic
イタリックフォントは強調のために使用されます, このように
boldface
ボールドフォントはアクセス権名(例えば、``process 権を容易に 与えないでください'')と、特に強い強調を伝えるために使用されます。

コマンドが特定のプログラムによって実行されることを意味することを表す時、 コマンドと共に表示されるプロンプトによって、そのプログラムを表します。例えば、 shell> は、あなたのログインシェルから実行するコマンドを表し、 mysql>mysql クライアントプログラムから実行するコマンドを表します:

shell> type a shell command here
mysql> type a mysql command here

シェルコマンドは Bourne シェル構文で示されます。csh 形式のシェ ルを使用している場合は、わずかに変更してコマンドを発行する必要があるでしょ う。例えば、環境変数を設定してコマンドを実行するシーケンスは、Bourne シェ ル構文では次のようになります:

shell> VARNAME=value some_command

csh では、次のようなシーケンスを実行してください:

shell> setenv VARNAME value
shell> some_command

データベース名, テーブル名, フィールド名はコマンドの中で置換しなければいけない ことがよくあります。このような置換が必要なことを示すために、このマニュア ルは db_name, tbl_name, col_name を使用します。 例えば、次のようなステートメントを見た場合:

mysql> SELECT col_name FROM db_name.tbl_name;

これは、同様のステートメントを入力するためには、おそらく次のように、あな た自身のデータベース名, テーブル名, フィールド名を供給することを意味します:

mysql> SELECT author_name FROM biblio_db.author_list;

SQL ステートメントは大文字でも小文字でも記述できます。このマニュアルが SQL ステートメントを示すときは、特別なキーワードを説明している時には(そ れを強調するために)そのキーワードに大文字が使用され、残りのステートメン トに小文字が使用されます。 例えば、SELECT ステートメントの説明中 には次が見られるでしょう:

mysql> SELECT count(*) FROM tbl_name;

一方、COUNT() 関数の説明中では、ステートメントは次のように書かれ ます:

mysql> select COUNT(*) from tbl_name;

特別な強調が意図されない場合、全てのキーワードは大文字で書かれます。

構文の説明中では、角括弧(`['`]')はオプションの単語や節であ ることを示すために使用されます:

DROP TABLE [IF EXISTS] tbl_name

構文要素がいくつかのものからなる場合、垂直バー(`|')で区切られます。 選択セットから一つのメンバを選ぶことができるときは、角括弧中にリストされ ます。(`[' and `]'):

TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)

選択セットから一つのメンバを選ぶ必要があるときは、波括弧(`{'`}')中にリストされます:

{DESCRIBE | DESC} tbl_name {col_name | wild}

1.1.5 MySQL の歴史

最初は、我々固有の速くて低レベルな (ISAM) ルーチンを使用したテーブルへ 接続するために、 mSQL を使用するつもりでした。 しかし、いくつかのテストの後、我々は mSQL は我々が必要とするほど高速ではなく、柔軟度を持っていないとの 結論に至りました。この結果、mSQL とほとんど同じ API インタフェー スを持つ、我々のデータベースへの新しい SQL インタフェースに帰結しました。 この API はサードパーティコードの移植を簡単にするために選択されました。

MySQL の名前の由来は完全には明らかではありません。我々のベース ディレクトリと多くのライブラリとツールは接頭辞 ``my'' を 10 年以上も使っ ています。しかし、Monty の娘(何年か若い)も My という名前です。そのため、 この2つのどちらが MySQL に名前を与えたかは、我々にとっても未だ 謎です。

1.1.6 MySQLの主な機能

MySQL の重要な特徴のいくつかを以下の項目にあげます:

1.1.7 MySQL はどれくらい安定か?

この節では、``MySQL はどれくらい安定か?'' と ``私はこのプロジェ クトの MySQL に依存できるか?'' という質問について回答します。

我々はここで、いくつかの問題を明らかにし、多くの人に関係すると思われるさ らに重要な質問のいくつかを回答することを試みます。この節は、メーリングリ スト(そこではとても活発にバグが報告されています)から取り込まれた情報が一 緒に置かれています。

TcX では、MySQL は 1996 中頃から我々のプロジェクトで何の問題も なく動いていました。広く公にリリースされた時、我々は、MySQL 内 に ``テストされていないコード'' の部分があることに注意しました。これは、 我々とは異なる方法でクエリを作成する新しいユーザによってすぐに見つけられました。 新しい各リリースは、(多くの新しい機能を持っているのに)前のものよりも問題 は少なくなります。そして次のリリースの一つを ``安定'' と呼ぶことができるよ うに我々は望んでいます。

MySQL の各リリースは実用的で、ユーザが ``グレイゾーン'' からの コードの使用を開始する時にだけ問題があります。当然、外部のユーザは、何が グレイゾーンかを知ることができません; この節で現在知られているこれらを示 してみます。 説明は MySQL の 3.23.x バージョンで扱われます。知られていて報告 されているバグは全て最新のバージョンで修正されています。bugs 節に 書かれているバグは除きます。それらは ``設計'' 関連のものです。 「1.4.7 MySQL での既知のエラーと欠けているデザイン」節参照.

MySQL は複数の階層と様々な独立モジュールで書かれています。これ らのモジュールは、それぞれがどのようにテストされているかとともに次にリス トされています:

ISAM テーブル処理 -- 安定
これは MySQL バージョン 3.22 とそれ以前のバージョンにおいて、 全てのデータの保存と検索を管理します。全ての MySQL リリースでは、 このコード内には(報告された)バグは一つもありません。不正なテーブルを得る 唯一の方法は、更新の途中にあるサーバを殺すことだけです。そして各クエリ間 で全てのデータはディスクにフラッシュされるため、いかなるデータも 修復外の破壊が起こるということはまずないでしょう。 MySQL 内のバグのためにデータが 失われたというバグレポートは一つもありません。
MyISAM テーブルハンドラー -- 安定
これは MySQL バージョン 3.23 での新機能です. これは ISAM テーブルのコードを元に拡張されていますが、 多くの便利な機能を持っています。
パーサと単語解析 -- 安定
このシステム内には長い間バグは一つも報告されていません。
C クライアントコード -- 安定
知られている問題はありません。バージョン 3.20 リリースの初期には、送信/受信バッファ サイズにいくつかの制限がありました。バージョン 3.21.x 以降、バッファはデフォルトの 16M まで動的に大きくなります。
標準クライアントプログラム -- 安定
これらは mysql, mysqladmin, mysqlshow, mysqldump, mysqlimport を含みます.
基本的な SQL -- 安定
基本的な SQL 機能システムと文字列節と動的メモリ処理。このシステムには報 告されたバグは一つもありません。
クエリオプティマイザ -- 安定
範囲オプティマイザ -- 安定
結合オプティマイザ -- 安定
ロック -- ガンマ
これはとてもシステムに依存しています。いくつかのシステムでは、これは、標 準 OS ロック (fcntl) を使用するため大きな問題があります。これらの場合で は、MySQL デーモンを --skip-locking フラグつきで動かすべ きです。知られている問題は、いくつかの Linux システムと NFS マウントされ たファイルシステム使用時の SunOS です。
Linux スレッド -- 安定
fcntl() コールでだけ問題が見つかっています。これは mysqld への --skip-locking オプションの使用で修正できます。何人かは バージョン 0.5 リリースで lockup 問題を報告しました。1000以上の同時接続を使用する予 定であれば、LinuxThreads を再コンパイルする必要があります。しかし、デフォ ルトの LinuxThread でも多くの接続を実行することは可能です(しかし 1021 以 上にならないようにしてください)。デフォルトの 2MB のスタック空間は、アプ リケーションを不安定にします。そして 1021 個のアイドル接続の生成後に coredump を引き起こします。詳しくは 「2.6.1 Linux Notes (All Linux Versions)」節参照. をご覧ください。
Solaris 2.5+ pthread -- 安定
我々は、我々の全ての製品でこれを使用しています。
MIT スレッド (他のシステム) -- 安定
バージョン 3.20.15 から報告されたバグはありません。バージョン 3.20.16 から知られたバグはありま せん。いくつかのシステムでは、いくつかの操作が遅くなるという ``misfeature'' があります(1/20 秒の sleep が各クエリ間で行なわれます)。 もちろん、MIT スレッドはすべてを少し遅くします。しかしインデックスベース の SELECT では、ステートメントは通常一度のフレームで行われるため、 mutex locking/thread juggling はありません。
他のスレッド実装 -- ベータ - ガンマ
他のシステムへの移行はまだとても新しく、多分 MySQL に、しかし一 番多いのはスレッド実装自身に、多くのバグを持っています。
LOAD DATA..., INSERT ... SELECT -- 安定
何人かはこれにバグを見つけたと考えましたが、それは結局誤解でした。問題の 報告の前にマニュアルを良くチェックしてください!
ALTER TABLE -- 安定
バージョン 3.22.12 で少し変更しました。
DBD -- 安定
現在、Jochen Wiedmann (wiedmann@neckar-alb.de) によってメンテされています。感謝!
mysqlaccess -- 安定
Yves Carlier (Yves.Carlier@rug.ac.be) によって書かれメンテされてます。感謝!
GRANT -- 安定
MySQL 3.22.12 で大きな変更が行なわれました。
MyODBC (uses ODBC SDK 2.5) -- ガンマ
いくつかのプログラムでちゃんと動作しているように見えます。
Replication -- ベータ / ガンマ
我々はまだレプリケーションについて作業中なので、まだ堅固に頑丈だとは期待し ないでください。一方、MySQL ユーザの何人かはすでにこれを使用して 良い結果を得ています。
BDB Tables -- ベータ
Berkeley DB コードはとても安定していますが、我々は MySQL と BDB テーブル間のインタフェースをさらに向上しています。他のテーブル型と同じよう にテストされるまではいくらかの時間が掛かるでしょう。
InnoDB Tables -- Beta
This is a recent addition to MySQL. They appear to work good and can be used after some initial testing.
MyISAM テーブルの自動修復 -- ベータ
テーブルが適切にクローズされたかどうかをオープン時にチェックし、行われてい ない場合にテーブルの自動チェック/修復を実行するという新しいコードだけに影 響します。
MERGE テーブル -- ベータ / ガンマ
MERGE テーブル上でのキーの使用は、まだテストされていません。 MERGE コードのほかの部分は完全にテストされています。
FULLTEXT -- ベータ
テキストの検索は動作しているように見えますが、まだ広く使用されていません。

MySQL AB は代金を支払った顧客のために email サポートを提供しています。しかし MySQL メーリングリストは通常、全ての一般的な質問に回答を提供し ています。バグは通常すぐにパッチで修正され、深刻なバグには、ほとんどいつ も新しいリリースがあります。

1.1.8 MySQLではどれだけテーブルを大きくできるの?

MySQL Version 3.22では、最大テーブルサイズに 4Gbyte という制限がありました。 MySQL Version 3.23から採用された新しい MyISAM では、 最大テーブルサイズは800万テラバイト( 2 ^ 63 bytes )に拡張されました。

ただし、OSの側にも、ファイルサイズの制限が存在していることには注意して下さい。 いくつか例を示します:

Operating System File Size Limit
Linux-Intel 32 bit 2G, 4G あるいはそれ以上, Linux のバージョンによる。
Linux-Alpha 8T (?)
Solaris 2.5.1 2G (パッチにより 4G に対応)
Solaris 2.6 4G
Solaris 2.7 Intel 4G
Solaris 2.7 ULTRA-SPARC 8T (?)

Linux 2.2 では、ext2ファイルシステム用のLFSパッチを適用することで、 2G 以上のテーブルを使用することができます。 Linux 2.4ではReiserFS用の同様のパッチが存在し、大きなファイルを扱うことができるようになります。 (訳注: Linux 2.4.1 以上では、最初から ReiserFS がカーネルのソースに組み込まれています)

以上からわかるように、MySQLの最大テーブルサイズはOSの制限によって決まることがほとんどです。

デフォルトでは、MySQLの最大テーブルサイズは4Gに設定されています。 あるテーブルの最大テーブルサイズは、SHOW TABLE STATUS コマンドか、 myisamchk -dv table_name によって確認することができます。 「4.5.5 SHOW 構文」節参照.

もしも4G 以上のテーブルが必要な場合には(加えて、OSがそれをサポートしている場合には)、 テーブルを作る際に、AVG_ROW_LENGTHMAX_ROWS パラメータを設定することができます。 「6.5.3 CREATE TABLE 構文」節参照. テーブル作成後に、ALTER TABLE で変更することもできます。 「6.5.4 ALTER TABLE 構文」節参照

読み込み専用の大きなテーブルが必要な時は、 myisampackを使って複数のテーブルを一つにまとめた上で圧縮することができます。 myisampackは、テーブルの大きさをだいたい50%程度まで圧縮できます。 結果として、より大きなテーブルを作ることが可能となるでしょう。 「4.7.4 myisampack, MySQL の圧縮された読み込み専用テーブルジェネレータ」節参照.

MyISAMデータファイルに対する、OSのファイル制限を回避するのに、 RAID オプションを使うこともできます。 「6.5.3 CREATE TABLE 構文」節参照.

MERGEライブラリ -- 同じ構造のテーブルをひとまとめに扱う機能を提供します -- を 使用するという解決法も考えられるでしょう。 「7.2 MERGE Tables」節参照.

1.1.9 2000 年対応

MySQL 自身は 2000 年問題(Y2K)に対して何の問題も持っていません:

2000年安全でない方法で MySQL を使用するアプリケーションでは問題 になります。例えば、多くの古いアプリケーションは4桁値ではなく2桁値(これ は曖昧です)を使用して年を格納し操作します。この問題は、00 または 99 のような値を ``欠けている'' 値の表われとして使用するアプリケー ションによって作られます。

あいにく、これらの問題を修正するのは困難です。様々なアプリケーションが様々 なプログラムによって書かれていて、その各々が慣習と日付操作関数の様々な組 み合わせを使用するからです。

これは、MySQL が 2030 年までの日付に何の問題もないことを示す簡単なテスト です:

mysql> DROP TABLE IF EXISTS y2k;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE y2k (date date, date_time datetime, time_stamp timestamp);
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO y2k VALUES 
    -> ("1998-12-31","1998-12-31 23:59:59",19981231235959),
    -> ("1999-01-01","1999-01-01 00:00:00",19990101000000),
    -> ("1999-09-09","1999-09-09 23:59:59",19990909235959),
    -> ("2000-01-01","2000-01-01 00:00:00",20000101000000),
    -> ("2000-02-28","2000-02-28 00:00:00",20000228000000),
    -> ("2000-02-29","2000-02-29 00:00:00",20000229000000),
    -> ("2000-03-01","2000-03-01 00:00:00",20000301000000),
    -> ("2000-12-31","2000-12-31 23:59:59",20001231235959),
    -> ("2001-01-01","2001-01-01 00:00:00",20010101000000),
    -> ("2004-12-31","2004-12-31 23:59:59",20041231235959),
    -> ("2005-01-01","2005-01-01 00:00:00",20050101000000),
    -> ("2030-01-01","2030-01-01 00:00:00",20300101000000),
    -> ("2050-01-01","2050-01-01 00:00:00",20500101000000);
Query OK, 13 rows affected (0.01 sec)
Records: 13  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM y2k;
+------------+---------------------+----------------+
| date       | date_time           | time_stamp     |
+------------+---------------------+----------------+
| 1998-12-31 | 1998-12-31 23:59:59 | 19981231235959 |
| 1999-01-01 | 1999-01-01 00:00:00 | 19990101000000 |
| 1999-09-09 | 1999-09-09 23:59:59 | 19990909235959 |
| 2000-01-01 | 2000-01-01 00:00:00 | 20000101000000 |
| 2000-02-28 | 2000-02-28 00:00:00 | 20000228000000 |
| 2000-02-29 | 2000-02-29 00:00:00 | 20000229000000 |
| 2000-03-01 | 2000-03-01 00:00:00 | 20000301000000 |
| 2000-12-31 | 2000-12-31 23:59:59 | 20001231235959 |
| 2001-01-01 | 2001-01-01 00:00:00 | 20010101000000 |
| 2004-12-31 | 2004-12-31 23:59:59 | 20041231235959 |
| 2005-01-01 | 2005-01-01 00:00:00 | 20050101000000 |
| 2030-01-01 | 2030-01-01 00:00:00 | 20300101000000 |
| 2050-01-01 | 2050-01-01 00:00:00 | 00000000000000 |
+------------+---------------------+----------------+
13 rows in set (0.00 sec)

これは、DATEDATETIME 型は未来のいかなる日付において 問題のないことををしめします (これら日付は 9999 年まで扱えます)

TIMESTAMP 型は、時刻を保存しますが、2030-01-01 までです。 TIMESTAMP は 32-bit マシンで(signed value)は 1970 から 2030 の範囲です。 64-bit マシンでは、 2106 年(unsigned value)まで扱えれます。

MySQL は 2000年対応ですが、曖昧でない入力を提供するのはあなたの 責任です。曖昧な日付の入力データ(2桁の年の値)の扱いについての MySQL の規則については 「6.2.2.1 西暦2000年問題とデータ型」節 を参照してください。

1.2 MySQL Information Sources

1.2.1 MySQL 関連の書籍

For the latest book information, with user comments, please visit http://www.mysql.com/portal/books/html/index.html.

このマニュアルからも最新の技術情報を得ることができますが、 その主目的は、 MySQLについての全てを網羅することです。 時には旅行中やベッドの上でも 気軽に読めるようなMySQL関連の本が欲しいということはないでしょうか。 以下にMySQL及び関連項目についての書籍の一覧を挙げておきます。 (英語)

表中のリンク先のサイトから書籍をご購入いただきますと、 その売上は MySQLの開発に役立てられます。

MySQL
入手先 Barnes and Noble
出版元 New Riders
著者名 Paul DuBois
発行日 初版 1999年12月
ISBN 0735709211
ページ数 800
価格 $49.99 US
ダウンロード可能なサンプル samp_db distribution
正誤表 ここにあります

はしがきはMySQLのモデレータ、 Michael ``Monty'' Widenius氏によって執 筆されました。

MySQLは最も人気のあるリレーショナルデータベースの一つ、MySQLについての 完全ガイドブックです。 著者のPaul DuBois氏はMySQLのオンラインドキュ メントの執筆にも貢献しており、 MySQLのコミュニティにおいて積極的に活 動を続けています。 原稿はMySQLの主要開発メンバーであるMonty Widenius 氏と彼のチームメンバーによって閲覧、評価され、 無比の識見をDuBois氏に与えまし た。

本書は単にMySQLについての一般的な概要を述べたものではなく、 MySQLの力を最大限に利用する方法が紹介されています。 2つのサンプルア プリケーションを通して、 MySQLユーザが必ず直面する問題への解決策が述べられて います。 本書はMySQLをPHPやPerlと言った、 サードパーティーの技術と効 率的に組み合わせて、 クエリを用いた動的なウェブページを構築する一助にもなりま す。 MySQLデータベースにアクセスするためのプログラムの書き方、 項目の データ形式、 演算子、 関数、 SQL構文、 MySQLプログラミング、 C言語API、 Perl DBI API、 PHP APIについての包括的なリファレンスが載っています。 MySQLには他の本には載っていないような情報が多く掲載されています。

本書の特徴は以下のとおりです。


MySQL & mSQL
入手先 Barnes and Noble
出版元 O'Reilly
著者名 Randy Jay Yarger, George Reese & Tim King
発行日 初版 1999年7月
ISBN 1-56592-434-7, 注文番号: 4347
ページ数 506
価格 $34.95

本書ではLinux, UNIXシステムの両方において主要なSQLをサポートする、 堅牢性に優 れた人気の2大データベース、 MySQLmSQLの使い方について解説し ています。 基本的なC、Java,Perl, Pythonを知っている方なら、スタンドアロン型で あれウェブページ用であれ誰でもデータ-ベースとやり取りするためのプログラムを 書くことができます。 本書ではインストールからプログラミング・インターフェース の設定、 基本的な管理の仕方までの全ての過程を網羅しております。 チュートリアル も豊富です。

Sams' Teach Yourself MySQL in 21 Days
入手先 Barnes and Noble
出版元 Sams
著者名 Mark Maslakowski and Tony Butcher
発行日 2000年6月
ISBN 0672319144
ページ数 650
価格 $39.99

Sams' Teach Yourself MySQL in 21 Daysは、 データ-ベースをはじめたい中 級Linuxユーザ向けの書籍です。 この本の読者の中で多数を占めるのは、インター ネットから得られる大量の情報を保管できるデータベースを必要とするWeb開発者で す。

Sams' Teach Yourself MySQL in 21 Daysはステップごとに解説した、 実用的 なチュートリアル本です。 実用的な、 現場に即した実例を使って、 オープンソースの データベースであるMySQLをウェブページ向けにデザイン、活用できるよう になります。

E-Commerce Solutions with MySQL
入手先 Barnes and Noble
出版元 Prima Communications, Inc.
著者名 該当なし
発行日 2000年1月
ISBN 0761524452
ページ数 500
価格 $39.99

解説なし

MySQL and PHP from Scratch
入手先 Barnes and Noble
出版元 Que
著者名 解説なし
発行日 2000年9月
ISBN 0789724405
ページ数 550
価格 $34.99

本書はApacheのインストール、 セットアップ、 トラブルシューティング、 MySQL、 PHP3、 IMPについての情報を全て1冊の本にまとめたものです。 Web ベースのEメールシステムを作り上げる方法をステップ毎に学習することによって、 個々の技術が全体の中でどんな役割を果たしているのかを学ぶこともできます。 PHP3 を使って、 Active Server Pages (ASP)と同等のことができるということや、 データ- ベースとApacheサーバーを使ったe-commerceサイトの立ち上げ、 パソコンへのインス トールを必要としないデータ入力システム(売上、 商品の品質管理、 顧客情報等)の作 成についても学習します。

Professional MySQL Programming
入手先 Barnes and Noble
出版元 Wrox Press, Inc.
著者名 該当なし
発行日 2001年後半期
ISBN 1861005164
ページ数 1000
価格 $49.99

解説なし

Professional Linux Programming
入手先 Barnes and Noble
出版元 Wrox Press, Inc.
著者名 該当なし
発行日 2000年9月
ISBN 1861003013
ページ数 1155
価格 $47.99

ベストセラー、 Beginning Linux Programmingの続編である本書では、 著者の 実際の開発場面における知識やLinuxプラットフォームでの開発経験から学ぶことが できます。 'DVD Store'というサンプルアプリケーションを開発するという筋立てに なっており、 'theme'の章ではアプリケーションのコーディングにおける異なった見 方が述べられています。 また、 'take-a-break'という項目では、 主題の範囲を越えた 重要なトピックについてカバーしております。 本書では仕事にあった正しいツールを 選び、 使うべきときにそのツールを使い、 初めて使った時点で成功させることについ ての重要性が示されており、 一冊全てにおいてプログラミングの実用的な側面につい て焦点が置かれています。

PHP and MySQL Web Development
入手先 Barnes and Noble
出版元 Sams
著者名 Luke Welling, Laura Thomson
発行日 2001年3月
ISBN 0672317842
ページ数 700
価格 $49.99

PHP and MySQL Web Developmentでは、 MySQLとPHPの両方を使うこ との利点について紹介されています。 これらの利点については統計、 事例研究の両面 からさらに細かく解説されています。 機能的なオンラインデータベースプログラミン グに必要なツールを紹介しながら、 一冊を通して実用的なWebアプリケーションを開 発していきます。 好きな部分だけコーディング・使用できるように、 各関数は別々に 実装・解説されています。 MySQLサポートをPHPスクリプトに組み入れるた めの関数や、 テーブル操作についての上級者向けトピックを含めた、 PHPプログラミ ングのコンセプトについても強調されています。

Books recommended by the MySQL Developers

SQL-99 Complete, Really
入手先 Barnes and Noble
出版元 CMP Books
著者名 Peter Gulutzan, Trudy Pelzer
発行日 1999年4月
ISBN 0879305681
ページ数 1104
価格 $55.96

本書ではSQLデータベースにおける文法、 データ構造、 データ取得プロセスの新基準 についての完全な説明がなされています。 CLIの全ての関数、 情報、 スキーマ・テー ブル、 ステータスコードが載っており、 実例中心のリファレンス本としても役立ちま す。 付属のディスクには実際に動かせるSQLデータベースも収録されています。

C, A reference manual
入手先 Barnes and Noble
出版元 Prentice Hall
著者名 Samuel P. Harbison, Guy L. Steele
発行日 1994年9月
ISBN 0133262243
ページ数 480
価格 $35.99

C言語リファレンスのベストセラーが改訂、 新版となりました。 本書は「クリーンな C」の概念、 C++プログラムとしてコンパイルできるCコードの書き方、 正確さ、 移植 性、 保守性に重点を置いたCプログラミングスタイルを紹介しております。 また、 移 植性が高く国際化対応したCプログラムを書くための新規格を定めたISO Amendment 1(1994年)も取り入れられています。

C++ for Real Programmers
入手先 Barnes and Noble
出版元 Academic Press, Incorporated
著者名 Jeff Alger, Jim Keogh
発行日 1998年2月
ISBN 0120499428
ページ数 388
価格 $39.95

C++ For Real Programmersは入門本に解説されているような初級、中級者向け のC++とエキスパートが実際に使っているC++のギャップの橋渡しとして書かれた本で す。 数々の一読に値するテクニックが 間接参照、 クラス階層、 メモリ管理の3章にわ たって紹介されています。 テンプレートの作成、 例外処理、 ポインタ、 最適化テク ニックについても詳細に扱っております。 本書はANSI C++に焦点を置いており、 特定 のコンパイラに依存しません。

C++ For Real ProgrammersSecrets of the C++ Mastersの改訂版 であり、 C++とJavaを比較した、 新しい付録が加わりました。 ソースコードを収録し たWindows用の3.5インチフロッピーディスクが付属でついています。

Algorithms in C
入手先 Barnes and Noble
出版元 Addison Wesley Longman, Inc.
著者名 Robert Sedgewick
発行日 1990年4月
ISBN 0201514257
ページ数 648
価格 $45.75

Algorithms in Cでは並べ替え、 検索、 文字列処理や、 幾何学、 グラフ、 数学 関連のアルゴリズム等、 数々の興味分野における様々なアルゴリズムについて解説さ れています。 本書では根本的なテクニックについて重点を置き、 役立つアルゴリズム を自信もってコーディング、実行、 デバッグする手段を紹介します。

Multithreaded Programming with Pthreads
入手先 Barnes and Noble
出版元 Prentice Hall
著者名 Bil Lewis, Daniel J. Berg
発行日 1997年10月
ISBN 0136807291
ページ数 432
価格 $34.95

Based on the best-selling ベストセラー、 Threads Primerを元にして執筆 されたMultithreaded Programming with Pthreadsは、 Posixスレッドについ ての理解を確実にすることが目的です。 Posixスレッドとは何か、 スレッドの仕組み、 どのようなときに使うべきか、 最適化の方法について述べられています。 Threads Primerの分かりやすくユーモアのある文章はそのままですが、 Win32 とOS/2プラットフォームにおけるスレッドの実行については前作よりさらに幅広く比 較されています。 主要な全てのUNIXプラットフォームでテスト済みのサンプルコード は、 スレッドを使用した理由、 どうやってスレッドを使用したのかについての詳細な 説明つきです。

Programming the PERL DBI: Database Programming with PERL
入手先 Barnes and Noble
出版元 O'Reilly & Associates, Incorporated
著者名 Alligator Descartes, Tim Bunce
発行日 2000年2月
ISBN 1565926994
ページ数 400
価格 $27.96

Programming the Perl DBIではDBIコミュニティで最も積極的な活動メンバー の一人、 Alligator Descartesや、 DBIの考案者であるTim Bunceが共著しています。 初学者向けには、 DBIの構造やDBIベースのプログラムの書き方について解説してあり ます。 上級者向けには、 DBIのニュアンスや個々のDBDの特色について解説されていま す。

本書の特徴として、次のようなものがあります。


1.2.2 一般的な SQL 情報とチュートリアル

この本は MySQL メーリングリストの数人によって推奨されています:

Judith S. Bowman, Sandra L. Emerson and Marcy Darnovsky
The Practical SQL Handbook: Using Structured Query Language
Second Edition
Addison-Wesley
ISBN 0-201-62623-3
http://www.awl.com

この本も MySQL ユーザーにいくつかの推薦を受けています:

Martin Gruber
Understanding SQL
ISBN 0-89588-644-8
Publisher Sybex 510 523 8233
Alameda, CA USA

SQL チュートリアルがネット上にあります http://w3.one.net/~jhoffman/sqltut.htm

1.2.3 便利な MySQL 関連リンク

次のリンク以外にも、多くの MySQL プログラム、ツール、API を Contrib directory から見つけてダウ ンロードすることができます。

MySQL

1.2.4 Tutorials and Manuals

MySQL Myths Debunked
MySQL used in the real world.
http://www.4t2.com/mysql
Information about the German MySQL mailing list.
http://www2.rent-a-database.de/mysql/
MySQL handbook in German.
http://www.bitmover.com:8888//home/bk/mysql
Web access to the MySQL BitKeeper repository.
http://www.analysisandsolutions.com/code/mybasic.htm
Beginners MySQL Tutorial on how to install and set up MySQL on a Windows machine.
http://www.devshed.com/Server_Side/MySQL/
A lot of MySQL tutorials.
http://mysql.hitstar.com/
MySQL manual in Chinese.
http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/
Setting Up a MySQL-based Web site.
http://www.hotwired.com/webmonkey/backend/tutorials/tutorial1.html
MySQL-Perl tutorial.
http://www.iserver.com/support/contrib/perl5/modules.html
Installing new Perl modules that require locally installed modules.
http://www.hotwired.com/webmonkey/databases/tutorials/tutorial4.html
PHP/MySQL Tutorial.
http://www.useractive.com/
Hands on tutorial for MySQL.

1.2.5 Porting MySQL/Using MySQL on Different Systems

http://www.entropy.ch/software/macosx/mysql/
Binary of MySQL for Mac OS X Client. Includes information of how to build and use MySQL on Mac OS X.
http://xclave.macnn.com/MySQL/
The Mac OS Xclave. Running MySQL on Mac OS X.
http://www.prnet.de/RegEx/mysql.html
MySQL for Mac OS X Server.
http://www.latencyzero.com/macosx/mysql.html
Building MySQL for Mac OS X.
http://www.essencesw.com/Software/mysqllib.html
New Client libraries for the Mac OS Classic (Macintosh).
http://www.lilback.com/macsql/
Client libraries for Mac OS Classic (Macintosh).
http://sixk.maniasys.com/index_en.html
MySQL for Amiga

1.2.6 Perl 関連リンク

http://dbimysql.photoflux.com/
Perl DBI with MySQL FAQ.

1.2.7 MySQL Discussion Forums

http://www.weberdev.com/
Examples using MySQL; (check Top 20)
http://futurerealm.com/forum/futureforum.htm
FutureForum Web Discussion Software.

1.2.8 Commercial Applications that Support MySQL

http://www.supportwizard.com/
SupportWizard; Interactive helpdesk on the Web (This product includes a licensed copy of MySQL.)
http://www.sonork.com/
Sonork, Instant Messenger that is not only Internet oriented. It's focused on private networks and on small to medium companies. Client is free, server is free for up to 5 seats.
http://www.stweb.org/
StWeb - Stratos Web and Application server - An easy-to-use, cross platform, Internet/Intranet development and deployment system for development of web-enabled applications. The standard version of StWeb has a native interface to MySQL database.
http://www.rightnowtech.com/
Right Now Web; Web automation for customer service.
http://www.icaap.org/Bazaar/
Bazaar; Interactive Discussion Forums with Web interface.
http://www.phonesweep.com/
PhoneSweepT is the world's first commercial Telephone Scanner. Many break-ins in recent years have come not through the Internet, but through unauthorized dial-up modems. PhoneSweep lets you find these modems by repeatedly placing phone calls to every phone number that your organization controls. PhoneSweep has a built-in expert system that can recognize more than 250 different kinds of remote-access programs, including Carbon Copy(TM), pcANYWHERE(TM), and Windows NT RAS. All information is stored in the SQL database. It then generates a comprehensive report detailing which services were discovered on which dial-up numbers in your organization.

1.2.9 SQL クライアントと Report Writers

urSQL
SQL Editor and Query Utility. Custom syntax highlighting, editable results grid, exportable result-sets, basic MySQL admin functions, Etc.. For Windows.
MySQL Data Manager
MySQL Data Manager * is platform independent web client (written in perl) for MySQL server over TCP/IP.
http://ksql.sourceforge.net/
KDE MySQL client.
http://www.ecker-software.de
A Windows GUI client by David Ecker.
http://www.icaap.org/software/kiosk/
Kiosk; a MySQL client for database management. Written in Perl. Will be a part of Bazaar.
http://www.casestudio.com/
Db design tool that supports MySQL 3.23.
http://home.skif.net/~voland/zeos/eng/index.html
Zeos - A client that supports MySQL, Interbase and PostgreSQL.
http://www.geocities.com/SiliconValley/Ridge/4280/GenericReportWriter/grwhome.html
A free report writer in Java
http://www.javaframework.de
MySQLExport - Export of MySQL create statements and data in a lot of different formats (SQL, HTML, CVS, text, ZIP, GZIP...)
http://dlabs.4t2.com
M2D, a MySQL Administration client for Windows. M2D supports administration of MySQL databases, creation of new databases and tables, editing, and more.
http://dlabs.4t2.com
Dexter, a small server written in Perl which can be used as a proxy server for MySQL or as a database extender.
http://www.scibit.com/Products/Software/Utils/Mascon.asp
Mascon is a powerful Win32 GUI for administering MySQL databases.
http://www.rtlabs.com/
MacSQL Monitor. GUI for MySQL, ODBC, and JDBC databases for the Mac OS.

1.2.10 Distributions that Include MySQL

http://www.suse.com/
SuSE Linux (6.1 and above)
http://www.redhat.com/
RedHat Linux (7.0 and above)
http://distro.conectiva.com.br
Conectiva Linux (4.0 and above)

1.2.11 Web Development Tools that Support MySQL

http://www.php.net/
PHP: A server-side HTML-embedded scripting language.
http://www.midgard-project.org
The Midgard Application Server; a powerful Web development environment based on MySQL and PHP.
http://www.smartworker.org
SmartWorker is a platform for Web application development.
http://xsp.lentus.se/
XSP: e(X)tendible (S)erver (P)ages and is a HTML embedded tag language written in Java (previously known as XTAGS.)
http://www.dbServ.de/
dbServ is an extension to a web server to integrate database output into your HTML code. You may use any HTML function in your output. Only the client will stop you. It works as standalone server or as Java servlet.
http://www.chilisoft.com/
Platform independent ASP from Chili!Soft
http://www.voicenet.com/~zellert/tjFM
A JDBC driver for MySQL.
http://www.wernhart.priv.at/php/
MySQL + PHP demos.
http://www.dbwww.com/
ForwardSQL: HTML interface to manipulate MySQL databases.
http://www.daa.com.au/~james/www-sql/
WWW-SQL: Display database information.
http://www.minivend.com/minivend/
Minivend: A Web shopping cart.
http://www.heitml.com/
HeiTML: A server-side extension of HTML and a 4GL language at the same time.
http://www.metahtml.com/
Metahtml: A Dynamic Programming Language for WWW Applications.
http://www.binevolve.com/
VelocityGen for Perl and Tcl.
http://hawkeye.net/
Hawkeye Internet Server Suite.
http://www.fastflow.com/
Network Database Connection For Linux
http://www.wdbi.net/
WDBI: Web browser as a universal front end to databases which supports MySQL well.
http://www.webgroove.com/
WebGroove Script: HTML compiler and server-side scripting language.
http://www.ihtml.com/
A server-side Web site scripting language.
ftp://ftp.igc.apc.org/pub/myodbc/README
How to use MySQL with ColdFusion on Solaris.
http://calistra.com/MySQL/
Calistra's ODBC MySQL Administrator.
http://www.webmerger.com
Webmerger - This CGI tool interprets files and generates dynamic output based on a set of simple tags. Ready-to-run drivers for MySQL and PostgreSQL through ODBC.
http://phpclub.net/
PHPclub - Tips and tricks for PHP.
http://www.penguinservices.com/scripts
MySQL and Perl Scripts.
http://www.widgetchuck.com
The Widgetchuck; Web Site Tools and Gadgets
http://www.adcycle.com/
AdCycle - advertising management software.
http://sourceforge.net/projects/pwpage/
pwPage - provides an extremely fast and simple approach to the creation of database forms. That is, if a database table exists and an HTML page has been constructed using a few simple guidelines, pwPage can be immediately used for table data selections, insertions, updates, deletions and selectable table content reviewing.
http://www.omnis-software.com/products/studio/studio.html
OMNIS Studio is a rapid application development (RAD) tool.
http://www.webplus.com
talentsoft Web+ 4.6 - a powerful and comprehensive development language for use in creating web-based client/server applications without writing complicated, low-level, and time-consuming CGI programs.

1.2.12 Database Design Tools with MySQL Support

http://www.mysql.com/documentation/dezign/
"DeZign for databases" is a database development tool that uses an entity relationship diagram (ERD).

1.2.13 Web Servers with MySQL Tools

ftp://ftp.kcilink.com/pub/
mod_auth_mysql, An Apache authentication module.
http://www.roxen.com/
The Roxen Challenger Web server.

1.2.14 Extensions for Other Programs

http://www.seawood.org/msql_bind/
MySQL support for BIND (The Internet Domain Name Server).
http://www.inet-interactive.com/sendmail/
MySQL support for Sendmail and Procmail.

1.2.15 Using MySQL with Other Programs

http://www.iserver.com/support/addonhelp/database/mysql/msaccess.html
Using MySQL with Access.
http://www.iserver.com/support/contrib/perl5/modules.html
Installing new Perl modules that require locally installed modules.

1.2.16 ODBC 関連リンク

http://www.iodbc.org/
Popular iODBC Driver Manager (libiodbc) now available as Open Source.
http://users.ids.net/~bjepson/freeODBC/
The FreeODBC Pages.
http://genix.net/unixODBC/
The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on the Linux platform. This is to include GUI support for KDE.
http://www.sw-soft.com/products/BtrieveODBC/
A MySQL-based ODBC driver for Btrieve.

1.2.17 API 関連リンク

http://www.jppp.com/
Partially implemented TDataset-compatible components for MySQL.
http://www.riverstyx.net/qpopmysql/
qpopmysql - A patch to allow POP3 authentication from a MySQL database. There's also a link to Paul Khavkine's patch for Procmail to allow any MTA to deliver to users in a MySQL database.
http://www.pbc.ottawa.on.ca
Visual Basic class generator for Active X.
http://www.essencesw.com/Software/mysqllib.html
New Client libraries for the Mac OS Classic (Macintosh).
http://www.lilback.com/macsql/
Client libraries for the Macintosh.
http://www.essencesw.com/Plugins/mysqlplug.html
Plugin for REALbasic (for Macintosh)
http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html
A library that emulates BSD sockets and pthreads on Macintosh. This can be used if you want to compile the MySQL client library on Mac. It could probably even be sued to port MySQL to Macintosh, but we don't know of anyone that has tried that.
http://www.dedecker.net/jessie/scmdb/
SCMDB - an add-on for SCM that ports the MySQL C library to scheme (SCM). With this library scheme developers can make connections to a MySQL database and use embedded SQL in their programs.

1.2.18 他の MySQL 関連リンク

SAT
The Small Application Toolkit (SAT) is a collection of utilities intended to simplify the development of small, multi-user, GUI based applications in a (Microsoft -or- X) Windows Client / Unix Server environment.
http://www.wix.com/mysql-hosting/
Registry of Web providers who support MySQL.
http://www.softagency.co.jp/mysql/index.en.html
Links about using MySQL in Japan/Asia.
http://abattoir.cc.ndsu.nodak.edu/~nem/mysql/udf/
MySQL UDF Registry.
http://www.open.com.au/products.html
Commercial Web defect tracking system.
http://www.stonekeep.com/pts/
PTS: Project Tracking System.
http://tomato.nvgc.vt.edu/~hroberts/mot
Job and software tracking system.
http://www.cynergi.net/exportsql/
ExportSQL: A script to export data from Access95+.
http://SAL.KachinaTech.COM/H/1/MYSQL.html
SAL (Scientific Applications on Linux) MySQL entry.
http://www.infotech-nj.com/itech/index.shtml
A consulting company which mentions MySQL in the right company.
http://www.pmpcs.com/
PMP Computer Solutions. Database developers using MySQL and mSQL.
http://www.aewa.org/
Airborne Early Warning Association.
http://www.dedserius.com/y2kmatrix/
Y2K tester.

1.2.19 SQL and Database Interfaces

http://java.sun.com/products/jdbc/
The JDBC database access API.
http://www.gagme.com/mysql
Patch for mSQL Tcl.
http://www.amsoft.ru/easysql/
EasySQL: An ODBC-like driver manager.
http://www.lightlink.com/hessling/rexxsql.html
A REXX interface to SQL databases.
http://www.mytcl.cx/
Tcl interface based on tcl-sql with many bugfixes.
http://www.binevolve.com/~tdarugar/tcl-sql/
Tcl interface.
http://www.contrib.andrew.cmu.edu/~shadow/sql.html
SQL Reference Page with a lot of interesting links.

1.2.20 MySQL 使用例

http://www.little6.com/about/linux/
Little6 Inc., An online contract and job finding site that is powered by MySQL, PHP3, and Linux.
http://www.delec.com/is/products/prep/examples/BookShelf/index.html
DELECis - A tool that makes it very easy to create an automatically generated table documentation. They have used MySQL as an example.
http://www.worldrecords.com
World Records - A search engine for information about music that uses MySQL and PHP.
http://www.webtechniques.com/archives/1998/01/note/
A Contact Database using MySQL and PHP.
http://modems.rosenet.net/mysql/
Web based interface and Community Calendar with PHP.
http://www.odbsoft.com/cook/sources.htm
Perl package to generate html from a SQL table structure and for generating SQL statements from an html form.
http://www.gusnet.cx/proj/telsql/
Basic telephone database using DBI/DBD.
http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break
JDBC examples by Daniel K. Schneider.
http://www.spade.com/linux/howto/PostgreSQL-HOWTO-41.html
SQL BNF
http://www.ooc.com/
Object Oriented Concepts Inc; CORBA applications with examples in source.
http://www.pbc.ottawa.on.ca/
DBWiz; Includes an example of how to manage cursors in VB.
http://keilor.cs.umass.edu/pluribus/
Pluribus is a free search engine that learns to improve the quality of its results over time. Pluribus works by recording which pages a user prefers among those returned for a query. A user votes for a page by selecting it; Pluribus then uses that knowledge to improve the quality of the results when someone else submits the same (or similar) query. Uses PHP and MySQL.
http://www.stopbit.com/
Stopbit - A technology news site using MySQL and PHP.
http://www.linuxsupportline.com/~kalendar/
KDE based calendar manager - The calendar manager has both single user (file based) and multi-user (MySQL database) support.
http://tim.desert.net/~tim/imger/
Example of storing/retrieving images with MySQL and CGI.
http://www.penguinservices.com/scripts
Online shopping cart system.
http://www.city-gallery.com/album/
Old Photo Album - The album is a collaborative popular history of photography project that generates all pages from data stored in a MySQL database. Pages are dynamically generated through a php3 interface to the database content. Users contribute images and descriptions. Contributed images are stored on the web server to avoid storing them in the database as BLOBs. All other information is stored on the shared MySQL server.

1.2.21 一般的な Database リンク

http://www.pcslink.com/~ej/dbweb.html
Database Jump Site
http://black.hole-in-the.net/guy/webdb/
Homepage of the webdb-l (Web Databases) mailing list.
http://www.symbolstone.org/technology/perl/DBI/index.html
Perl DBI/DBD modules homepage.
http://www.student.uni-koeln.de/cygwin/
Cygwin tools. Unix on top of Windows.
http://dbasecentral.com/
dbasecentral.com; Development and distribution of powerful and easy-to-use database applications and systems.
http://www.tek-tips.com/
Tek-Tips Forums are 800+ independent peer-to-peer non-commercial support forums for Computer Professionals. Features include automatic e-mail notification of responses, a links library, and member confidentiality guaranteed.
http://www.public.asu.edu/~peterjn/btree/
B-Trees: Balanced Tree Data Structures.
http://www.fit.qut.edu.au/~maire/baobab/lecture/sld001.htm
A lecture about B-Trees.

MySQL を使用した多くの web ページもあります。 「B Some MySQL Users」節参照。この リストへ追加できるものを webmaster@mysql.com に送ってください。 あなたのサイトを追加してほしいとあなたが望む場合、我々は MySQL の ロゴをどこかに示すことを要求しています。(``使用ツール'' ページや似たような どこか上で構いません。)

1.2.22 MySQL Mailing Lists

この章は MySQL メーリングリストを紹介し、それをどのように使用する かのガイドラインを提供します。

1.2.22.1 MySQL メーリングリスト

メイン MySQL メーリングリストを購読するには、メッセージを 電子メールアドレス mysql-subscribe@lists.mysql.com に送ってください。

メイン MySQL メーリングリストの購読の中止は、メッセージを 電子メールアドレス mysql-unsubscribe@lists.mysql.com に送ってください。

メッセージを送る先のアドレスだけが重要です。メッセージのサブジェクトと 本文は無視されます。

もし、あなたのリプライアドレスが妥当な物でない場合、アドレスを明確に指定することが出来ます。 subscribe あるいは unsubscribe のあとにハイフンを付け、そのあとにあなたの アドレスを記述します。ただし `@' 文字は `=' に置き変えて書きます。 例えば、 your_name@host.domain で購読したい場合、 mysql-subscribe-your_name=host.domain@lists.mysql.com 宛にメッセージを送ります。

mysql-subscribe@lists.mysql.commysql-unsubscribe@lists.mysql.com へのメールは ezmlm メーリングリストプロセッサによって自動的に処理されます。 ezmlm についての情報は The ezmlm Website.

本メーリングリストへの投稿を行うには、mysql@lists.mysql.com にメッセージを送ります。 しかし、subscribe あるいは unsubscribe のメールを mysql@lists.mysql.com送らないでください。 これらのアドレスへ送られたメールは、何千ものユーザーに配送されてしまいます。

あなたのローカルサイトが多くの mysql@lists.mysql.com 購読者を持つことも あります。この場合、ローカルメーリングリストを作り、lists.mysql.com からの 一つのメッセージがそのサイトに送られ、ローカルなリストで複写されるように してください。この場合、ローカルの MySQL リストへの追加と削除は、 あなたのシステム管理者に問い合わせて下さい。

あなたのメーラーでMySQL メーリングリストからのメールを 適切なメールボックスへ振り分けるには、 (振り分け用の)フィルタをメッセージヘッダを頼りに動作するよう設定して下さい。 その場合、List-ID: ヘッダか Delivered-To: ヘッダが 識別の役に立つことでしょう。

次の MySQL メーリングリストがあります:

announce-subscribe@lists.mysql.com announce
これは MySQL と関連プログラムの新しいバージョンのアナウンスのた めです。これは、全ての MySQL ユーザが入るべきと我々が考える少な い量のリストです。
mysql-subscribe@lists.mysql.com mysql
一般の MySQL 議論のための主なリストです。さらに専門的なリストに 行くべきものもあることに注意してください。間違ったリストに投稿しても、答 を得られないでしょう!
mysql-digest-subscribe@lists.mysql.com mysql-digest
ダイジェスト形式の mysql リストです。これは、一日に一回、一つの大 きなメールが送られることで個々のメッセージ全てが得られることを意味します。
bugs-subscribe@lists.mysql.com bugs
このリストには、完全で再現可能なバグレポートだけを、mysqlbug を使 用して投稿すべきです(Windows 上で実行している場合は、OS と MySQL バージョンの記述を含めるべきです)。できれば、投稿前に MySQL の最新の安定バージョンか開発バージョンを使用して問題をテ ストすべきです! 含められたテストケース上で、mysql test < script を使 用することで、誰もがバグを再現できるべきです。このリストに投稿された全て のバグは、次の MySQL リリースで修正されるかドキュメント化されま す! 小さなコードの変更だけですめば、我々はこの問題を修正するパッチの投 稿も行ないます。
bugs-digest-subscribe@lists.mysql.com bugs-digest
ダイジェスト形式の bugs リストです。
internals-subscribe@lists.mysql.com internals
MySQL コード上で作業する人のためのリストこのリストでも MySQL 開発の議論とパッチの投稿が可能です。
internals-digest-subscribe@lists.mysql.com internals-digest
internals リストのダイジェストバージョン。
java-subscribe@lists.mysql.com java
MySQL と Java についての議論。多くは JDBC ドライバについてです。
java-digest-subscribe@lists.mysql.com java-digest
java リストのダイジェストバージョン。
win32-subscribe@lists.mysql.com win32
Win95, Win98, NT, Win2000 のような Microsoft OS 上の MySQL に関連する全て。
win32-digest-subscribe@lists.mysql.com win32-digest
win32 リストのダイジェストバージョン。
myodbc-subscribe@lists.mysql.com myodbc
ODBC で MySQL への接続に関連する全て。
myodbc-digest-subscribe@lists.mysql.com myodbc-digest
myodbc リストのダイジェストバージョン。
plusplus-subscribe@lists.mysql.com plusplus
MySQL の C++ API でのプログラミングについての全て。
plusplus-digest-subscribe@lists.mysql.com plusplus-digest
plusplus リストのダイジェストバージョン。
msql-mysql-modules-subscribe@lists.mysql.com msql-mysql-modules
MySQL でサポートする Perl についてのリスト。msql-mysql-modules
msql-mysql-modules-digest-subscribe@lists.mysql.com msql-mysql-modules-digest
msql-mysql-modules リストのダイジェストバージョン。

上述したのと同じ方法で全てのリストの購読または購読中止ができます。あなた の購読または購読中止のメッセージは、mysql ではなく適切なメーリングリス トに送ってください。例えば、 myodbc リストを購読または購読中止するには、 myodbc-subscribe@lists.mysql.com または myodbc-unsubscribe@lists.mysql.com にメールを送ります。

メーリングリストから有益な回答が得られない場合、MySQL ABに 有料のサポートを求めることもできます。有料サポートが必要な場合、 MySQL 開発チームに直接御連絡下さい( 「1.3.5 Types of Commercial Support」節参照)。

次の表は英語以外の MySQL メーリングリストを示します。注意: これら は MySQL AB によって運用されていません。そのため、我々はそれらの 品質を保証できません。

mysql-france-subscribe@yahoogroups.com フランス語メーリングリスト
list@tinc.net 韓国語メーリングリスト
このリストに subscribe mysql your@email.address をメールしてください。
mysql-de-request@lists.4t2.com ドイツ語メーリングリスト
このリストに subscribe mysql-de your@email.address をメールしてください。 これについては http://www.4t2.com/mysql で情報を見つけられます。
mysql-br-request@listas.linkway.com.br ポルトガル語メーリングリスト
このリストに subscribe mysql-br your@email.address をメールしてください。
mysql-alta@elistas.net スペイン語メーリングリスト
このリストに subscribe mysql your@email.address をメールしてください。

1.2.22.2 質問またはバグ報告

メーリングリストへ質問を尋ねる前に、以下の手順を踏んでください:

ここで回答が見つけられない場合は、近くの MySQL 熟練者ととも に調べて下さい。まだあなたの質問の回答が見つけられなければ、先に進み、次 のセクションの mysql@lists.mysql.com へメールを送る方法についてを読んで ください。

1.2.22.3 バグや問題を報告する方法

良いバグレポートを書くのは忍耐が要りますが、それを最初に正しく行なうこと は我々とあなたから時間を節約します。 そのバグについての完全なテストケースを含む良いバグレポートは、次のリリー スでそれが修正される可能性がとても高くなります。 この節では、かなりの、または全く我々 の助けにならないことにあなたの時間を浪費しないように、あなたがレポートを 正しく書くことを手助けします。

我々は、バグレポートまた可能ならば全ての問題についてのレポートの作成に mysqlbug スクリプトを使用することを奨励します。mysqlbug は ソース配布内の `scripts' ディレクトリ、または、バイナリ配布では MySQL をインストールしたディレクトリ配下の `bin' ディレク トリから見つけられます。mysqlbug を使用できない場合は、この節に挙 げられている全ての必要な情報を含めるべきです。

mysqlbug スクリプトは、下記の多くの情報を自動的に見つけ出すことで、 レポートの作成を手助けします。しかし、重要な何かが足りない場合、あなたの メッセージにそれを含めてください! この節を慎重に読んで、ここで述べられ ている全ての情報がレポート中に含まれていることを確認してください。

バグや問題を報告する通常の場所は、mysql@lists.mysql.com です。 バグを明確に示すテストケースを作ることができれば、 bugs@list.mysql.com リストにそれを投稿してください。注意: この リストには、完全で再現可能なバグ情報を mysqlbug スクリプトを使用 して投稿すべきです。 Windows 上で実行している場合は、OS と MySQL バージョンの記述を含めるべきです。できれば、投稿前に MySQL の最新の安定バージョンか開発バージョンを使用して問題をテ ストすべきです! 含められたテストケース上で、'mysql test < script' を使 用することで、または、バグレポートに含められたシェル/Perlスクリプトを実 行することで、誰もがバグを再現できるべきです。このリストに投稿された全て のバグは、次の MySQL リリースで修正されるかドキュメント化されま す! 小さなコードの変更だけですめば、我々はこの問題を修正するパッチの投 稿も行ないます。

多すぎる情報を含むメッセージに答えることはできますが、少なすぎる情報を含 むものにはできないということを覚えていてください。しばしば人は事実を省い てしまいます。問題の原因をわかっていると思い、いくつかの詳細を重大でない と見なしてしまうからです。良い原則は: 何かを言おうか迷ったときには、言っ てください! 最初にあなたが十分な情報を含めなかったために、再び質問して 回答を待つことを強要されるより、数行をあなたのレポートに書く方が千倍速く て迷惑ではありません。

良くある間違いは、使用している MySQL 配布のバージョン番号を示さ ない、または MySQL をインストールしたプラットフォームを(プラッ トフォームのバージョン番号を含めて)示さない事です。これはとても関連した 情報で、100 のバグレポートのうち 99 の場合、この情報がないと役に立ちませ ん! 我々は ``何故私では動作しないの?'' のような質問をとても良く受けま す。そして我々は、要求された機能はその MySQL バージョンに実装さ れていない、または、レポート中に述べられているバグは新しい MySQL バージョンで既に修正されているであることを見つけます。時々、 エラーはプラットフォーム依存で、オペレーティングシステムとプラットフォー ムのバージョン番号を知らないことには、何も修正することはできません。

問題に関連している場合は、コンパイラについての情報も与えることを忘れない でください。しばしば人はコンパイラのバグを見つけて、問題は MySQL に関連していると考えます。多くのコンパイラはいつも開発中 で、バージョンを上げることによってより良いバージョンになります。問題がコ ンパイラに依存しているかどうかを確定するには、どのコンパイラが使用されて いるかを知ることが必要です。全てのコンパイルの問題はバグレポートとみなさ れ、それに従って報告されるべきであることに注意してください。

最も役に立つのは、問題の良い説明がバグレポートに含められることです。つま り、問題に導かれる全ての行なったことの例と、正確に記述された問題それ自身 です。良いバグレポートは、バグや問題を再現する方法を示す完全な例を含むも のです。 「G.1.6 Making a test case when you experience table corruption」節参照.

問題がエラーメッセージを与える場合、それをレポートに含めることはとても重 要です! 我々がプログラムを使用するアーカイブから何かを検索しようとする 場合、エラーメッセージはプログラムが与えたものと正確に一致する方が良いで す(大文字小文字も守られるべきです!)。どのようなエラーメッセージだったか を覚えるなんてことはしてはいけません;レポートに完全なメッセージをコピー し張りつけてください。

MyODBC での問題がある場合、MyODBC トレースファイルの生成を試みるべきです。 「8.3.7 Reporting Problems with MyODBC」節参照.

あなたのレポートを読む多くの人が 80桁ディスプレイを使用しているというこ とを覚えておいて下さい。従って、mysql コマンドラインツールを使用 してレポートまたはサンプルを生成する時、そのようなディスプレイの有効幅を 超える出力(例えば、EXPLAIN SELECT ステートメント; 後述のサンプル を見てください)には、--vertical オプション(または \G ステー トメント終端)を使用すべきです。

次の情報をレポートに含めてください:

もしあなたがサポート顧客なら、より高い優先度で取り扱われるように、バグレポー トを mysql-support@mysql.com と、そして同様に、他の誰かが問題を経 験済み(そして、もしかしたら解決済み)かどうかを調べるために、適切なメーリン グリストにもクロスポストしてください。

MyODBC のバグ報告上の情報については、 「8.3.4 MyODBC での問題をどのように報告すべきか?」節 を参照 してください。

いくつかの一般的な問題の解決法のために → 「A Problems and Common Errors」節参照.

回答があなたに個人的に送られて、メーリングリストに送られていない時、回答 を要約し、あなたの問題の解決の手助けになった返事の恩恵を他の人にも与える ために、その要約をメーリングリストに送信することは、良いエチケットです!

1.2.22.4 メーリングリストで質問に答えるためのガイドライン

あなたの回答が広く関心を持たれると考えられる場合、尋ねた人に個人的に直接 返事をする代わりに、メーリングリストに投稿したいと思うでしょう。オリジナ ルの投稿者以外の人もそれから恩恵を受けられるように十分一般的に回答を作成 することを試みてください。メーリングリストに投稿する場合は、あなたの回答 が以前の回答と重複していないか確認して下さい。

あなた返事の中で、質問の本質部分の要約を試みてください。質問全体を引用す ることを義務と感じないで下さい。

HTML モードを ON にしたブラウザからメールメッセージを投稿しないでくださ い! 多くのユーザはブラウザでメールを読んでいません!

1.3 MySQL ライセンスとサポート

(訳注: ライセンスの章については、正確さをきすため原文を併記しています。 訳文だけでなく原文に目を通してください。 もし意味の取違いを見つけたなら、takeshi@SoftAgency.co.jp に連絡してください。)

本節では MySQL のサポートとライセンシング契約について述べます。

1.3.1 MySQL Licensing Policy

The formal terms of the GPL license can be found at 「K GNU GENERAL PUBLIC LICENSE」節. Basically, our licensing policy and interpretation of the GPL is as follows:

古いバージョンのMySQLは より 制限されたライセンスを 有していることに気をつけて下さい。 より詳しくは、それぞれのバージョンに添付のドキュメントを御覧下さい。 もしGPLがあなたの作るアプリケーションにそぐわない場合、 https://order.mysql.com/で商用のMySQL のライセンスを購入することができます。

For normal internal use, MySQL costs nothing. You do not have to pay us if you do not want to.

A license is required if:

A license is NOT required if:

For circumstances under which a MySQL license is required, you need a license per machine that runs the mysqld server. However, a multiple-CPU machine counts as a single machine, and there is no restriction on the number of MySQL servers that run on one machine, or on the number of clients concurrently connected to a server running on that machine!

If you have any questions as to whether or not a license is required for your particular use of MySQL, please read this again and then contact us. 「1.3.4.2 Contact Information」節参照.

If you require a MySQL license, the easiest way to pay for it is to use the license form on MySQL's secure server at https://order.mysql.com/. Other forms of payment are discussed in 「1.3.4.1 Payment information」節.

1.3.2 Copyrights Used by MySQL

There are several different copyrights on the MySQL distribution: MySQL 配布における、いくつか異なるコピーライトを示します:

  1. The MySQL-specific source needed to build the mysqlclient library is licensed under the LGPL and programs in the `client' directory is GPL. Each file has a header that shows which copyright is used for that file.
  2. The client library and the (GNU getopt) library are covered by the ``GNU LIBRARY GENERAL PUBLIC LICENSE.'' 「L GNU LESSER GENERAL PUBLIC LICENSE」節参照.
  3. Some parts of the source (the regexp library) are covered by a Berkeley-style copyright.
  4. All the source in the server and the (GNU readline) library is covered by the ``GNU GENERAL PUBLIC LICENSE.'' 「K GNU GENERAL PUBLIC LICENSE」節参照. This is also available as the file `COPYING' in the distributions.

One goal is that the SQL client library should be free enough that it is possible to add MySQL support into commercial products without a license. For this reason, we chose the LGPL license for the client code.

This means that you can use MySQL for free with any program that uses any of the free software licenses. MySQL is also free for any end user for his own or company usage.

However, if you use MySQL for something important to you, you may want to help secure its development by purchasing licenses or a support contract. 「1.3.5 Types of Commercial Support」節参照.

1.3.2.1 Copyright Changes

Version 3.22 of MySQL is still using a more strict license. See the documentation for that version for more information.

1.3.3 Example Licensing Situations ライセンス適用例

This section describes some situations illustrating whether or not you must license the MySQL server. Generally these examples involve providing MySQL as an integral part of a product.

Note that a single MySQL license covers any number of CPUs and mysqld servers on a machine! There is no artificial limit on the number of clients that connect to the server in any way.

1.3.3.1 Selling Products that use MySQL

To determine whether or not you need a MySQL license when selling your application, you should ask whether the proper functioning of your application is dependent on the use of MySQL and whether you include the MySQL server with your product. There are several cases to consider:

1.3.3.2 ISP MySQL Services

Internet Service Providers (ISPs) often host MySQL servers for their customers. With the GPL license this does not require a license.

インターネットサービスプロバイダー(ISP) は MySQL サーバーを自分のお客に 提供することもしばしばです。 GPL ライセンスでは、この場合はライセンスが要求されません。

On the other hand, we do encourage people to use ISPs that have MySQL support, as this will give them the confidence that if they have some problem with their MySQL installation, their ISP will be able to solve the problem for them (in some cases with the help from the MySQL development team).

All ISPs that want to keep themselves up-to-date should subscribe to our announce mailing list so that they can be aware of fatal issues that may be relevant for their MySQL installations.

Note that if the ISP doesn't have a license for MySQL, it should give its customers at least read access to the source of the MySQL installation so that its customer can verify that it is patched correctly.

1.3.3.3 Running a Web Server Using MySQL

If you use MySQL in conjunction with a Web server on Unix, you don't have to pay for a license.

This is true even if you run a commercial Web server that uses MySQL, because you are not selling an embedded MySQL version yourself. However, in this case we would like you to purchase MySQL support, because MySQL is helping your enterprise.

もしあなたが UNIX 上で Webサーバー とともに MySQL を使用するなら、 ライセンスを買う必要はありません。

これはたとえ MySQL を使用した商用の Webサーバー を走らせていても、 MySQL 自身を売っていないので、ライセンスを買う必要はありません。 しかしこの場合、我々はあなたが MySQL サポート契約をすることを望みます。 なぜなら、MySQL はあなたの事業を助けているからです。

1.3.4 MySQL Licensing and Support Costs

Our current license prices are shown below. To make a purchase, please visit https://order.mysql.com/.

If you pay by credit card, the currency is EURO (European Union Euro) so the prices will differ slightly.

Number of licenses Per copy
1-9 230 EURO
10-24 138 EURO
25-49 117 EURO
50-99 102 EURO
100-249 91 EURO
250-499 76 EURO
500-999 66 EURO

For high volume (OEM) purchases, please contact sales@mysql.com.

For OEM purchases, you must act as the middle-man for eventual problems or extension requests from your users. We also require that OEM customers have at least an extended e-mail support contract. Note that OEM licenses only apply for products where the user doesn't have direct access to the MySQL server (embedded system). In other words, the MySQL server should only be used with the application that was supplied you.

 OEM 販売をする場合、ユーザーからの問題や要望に対して、 あなたは仲買人として振る舞わなくてはなりません。 われわれは OEM の客に対し、少なくとも拡張電子メールサポート契約を要求します。 OEM ライセンスは、MySQL サーバーに直接アクセスする必要のない 製品にのみ適用されます (組み込みシステム)。 いうならば、 MySQL は、ただ、あなたが提供しているアプリケーションと共にのみ 使用されなくてはなりません。 (訳注: OEM 供給を受けた MySQL サーバーライセンスのみを単体で売ることはできないという事。)

If you have a low-margin, high-volume product, you can always talk to us about other terms (for example, a percent of the sale price). If you do, please be informative about your product, pricing, market, and any other information that may be relevant.

 もしあなたが薄利多売の製品を持っているなら、他の条件についていつでも 我々と話し合うことができます(例えば売値のパーセンテージとか)。 もしあなたが製品を売りたいなら、 あなたの製品説明、値段、市場、その他関連項目を我々に知らせてください。

A full-price license is not a support agreement and includes very minimal support. This means that we try to answer any relevant questions. If the answer is in the documentation, we will direct you to the appropriate section. If you have not purchased a license or support, we probably will not answer at all.

完全な価格ライセンスはサポート協定でなく,非常に最小限のサポートを含みます. これは,我々が どんな関連質問にも答えようとする事を意味します. 返事がドキュメントにあるならば, 我々は適切なセクションをあなた示すつもりです. あなたがライセンスかサポートを購入 しなかったならば, 我々はたぶん全く答えるつもりはありません.

If you discover what we consider a real bug, we are likely to fix it in any case. But if you pay for support we will notify you about the fix status instead of just fixing it in a later release.

もしあなたが、我々が本当にバグだと考える物を見つけた場合、いかなる場合でも それを修正します。 しかし, あなたがサポートを支払うならば, 後のリリースでそれを修正する事の代わりに、 我々は修正状態に関してあなたに通知するつもりです.

More comprehensive support is sold separately. Descriptions of what each level of support includes are given in 「1.3.5 Types of Commercial Support」節. Costs for the various types of commercial support are shown below. Support level prices are in EURO (European Union Euro). One EURO is about 1.06 USD.

より包括的なサポートは別々に販売されます. それぞれのレベルのサポートが含む事に 関する記述は 「1.3.5 Types of Commercial Support」節. にあります。様々なタイプの商用サポートの価格は以下に 示します. サポートレベル価格は EURO (European Union Euro) です。 1 EURO はおよそ 1.06 USD です.

Type of support Cost per year
Basic e-mail support. 「1.3.5.1 Basic E-mail Support 基本電子メールサポート」節参照. EURO 200
Extended e-mail support 「1.3.5.2 Extended E-mail Support 拡張電子メールサポート」節参照. EURO 1000
Login support 「1.3.5.3 Login Support」節参照. EURO 2000
Extended login support 「1.3.5.4 Extended Login Support」節参照. EURO 5000
Telephone support 「1.3.5.5 Telephone Support」節参照. EURO 12000

You may upgrade from any lower level of support to a higher level of support for the difference in price between the two support levels.

下位レベルのサポートから、それより高いレベルのサポートに、 2つのサポートの価格差分の支払いで、アップグレードが可能です。

We do also provide telephone support (mostly emergency support but also 24/7 support). This support option doesn't however have a fixed price but is negotiated for case to case. If you are interested in this option you can email sales@mysql.com and tell us about your needs.

Note that as our sales staff is very busy, it may take some time until your request is handled. Our support staff does however always answer promptly to support questions!

1.3.4.1 Payment information

Currently we can take SWIFT payments, checks, or credit cards.

現在,SWIFT支払い,小切手またはクレジットカードでの支払いができます.

Payment should be made to:

Postgirot Bank AB
105 06 STOCKHOLM, SWEDEN

MySQL AB
BOX 6434
11382 STOCKHOLM, SWEDEN

SWIFT address: PGSI SESS
Account number: 96 77 06 - 3

Specify: license and/or support and your name and e-mail address.

あなたの購入ライセンス かつ/又は サポートと,名前と Eメールアドレスを記述のこと。

In Europe and Japan you can use EuroGiro (that should be less expensive) to the same account.

ヨーロッパと日本では,あなたは支払いに EuroGiro(それが高価ではない) を使用することができます.

If you want to pay by check, make it payable to ``MySQL Finland AB'' and mail it to the address below:

あなたが小切手によって支払いたいと思っているならば,それを ``MySQL Finland AB'' に支払い満期にして, 以下のアドレスに郵送してください.

MySQL AB
BOX 6434, Torsgatan 21
11382 STOCKHOLM, SWEDEN

If you want to pay by credit card over the Internet, you can use MySQL AB's secure license form.

インターネット上でクレジットカードで支払いたいと思っているならば, あなたは TcXの安全なライセンスフォーム. を使用することができます.

You can also print a copy of the license form, fill it in, and send it by fax to:

また上のページのコピーを印刷して書き込み,ファックスを使って以下にそれを送ることもできます.

+46-8-729 69 05

If you want us to bill you, you can use the license form and write ``bill us'' in the comment field. You can also mail a message to sales@mysql.com (not mysql@lists.mysql.com!) with your company information and ask us to bill you.

請求書を送って欲しい場合,あなたはライセンスフォームを使用し, 注釈欄に ``請求書 希望'' を書いてください. あるいは,あなたの会社の情報を記載したメッセージを sales@mysql.com におくり, (mysql@lists.mysql.com ではありません!) 請求書を送るように我々に依頼する事もできます。

1.3.4.2 Contact Information

For commercial licensing, please contact the MySQL licensing team. The much preferred method is by e-mail to licensing@mysql.com. Fax is also possible but handling of these may take much longer (Fax +46-8-729 69 05).

If you represent a business that is interested in partnering with MySQL, please send e-mail to partner@mysql.com.

For timely, precise answers to technical questions about MySQL you should order one of our support contracts. MySQL support is provided by the MySQL developers so the standard is extremely high.

If you are interested in placing a banner advertisement on our Web site, please send e-mail to advertising@mysql.com.

If you are interested in any of the jobs listed in our jobs section, please send e-mail to jobs@mysql.com.

For general discussion amongst our many users, please direct your attention to the appropriate mailing list.

For general information inquires, please send e-mail to info@mysql.com.

For questions or comments about the workings or content of the Web site, please send e-mail to webmaster@mysql.com.

1.3.5 Types of Commercial Support

The following is true of all support options:

1.3.5.1 Basic E-mail Support 基本電子メールサポート

Basic e-mail support is a very inexpensive support option and should be thought of more as a way to support our development of MySQL than as a real support option. We at MySQL do give a lot of free support in all the different MySQL lists, and the money we get from basic e-mail support is largely used to make this possible.

基本電子メールサポートは非常に費用のかからないサポートオプションであり, 我々の MySQL の開発をサポートする本当のサポートオプションで、 よりよい方法として考えられるべきです.

At this support level, the MySQL mailing lists are the preferred means of communication. Questions normally should be mailed to the primary mailing list (mysql@lists.mysql.com) or one of the other regular lists (for example, win32@lists.mysql.com for Windows-related MySQL questions), as someone else already may have experienced and solved the problem you have. 「1.2.22.2 質問またはバグ報告」節参照.

このサポートレベルでは, MySQL メーリングリストはコミュニケーション を取るには好まれる方法です. 通常, 質問は主要なメーリングリスト (mysql@lists.mysql.com) か他のメーリングリストのどれかに送信されるべきで、 (例えば, Windows に関連する MySQL の質問のための win32@lists.mysql.com ) これは他の誰かが同じ問題を経験して, 既に解決しているかもしれないからです。 「1.2.22.2 質問またはバグ報告」節参照.

However, by purchasing basic e-mail support, you also have access to the support address mysql-support@mysql.com, which is not available as part of the minimal support that you get by purchasing a MySQL license. This means that for especially critical questions, you can cross-post your message to mysql-support@mysql.com. (If the message contains sensitive data, you should post only to mysql-support@mysql.com.)

REMEMBER! to ALWAYS include your registration number and expiration date when you send a message to mysql-support@mysql.com.

しかし、基本電子メールサポートを購入することによって, あなたはサポートアドレス mysql-support@mysql.com にアクセスできます. (このメールアドレスは最小の MySQL ライセンスの購入では利用不可能です。) これは特に重要な質問のために使用されており、また、mysql-support@mysql.com. とクロスポストすることも可能です。 (メッセージに機密のデータが含まれる場合、あなたは mysql-support@mysql.com. だけに送信するべきです.)

メッセージを mysql-support@mysql.com に送るときは、 迅速な応答を確実にするために、必ずあなたの登録番号と満了日付を書き添えてください。

Note that if you have encountered a critical, repeatable bug, and follow the rules outlined in the manual section of how to report bugs and send it to bugs@lists.mysql.com, we promise to try to fix this as soon as possible, regardless of your support level! 「1.2.22.3 バグや問題を報告する方法」節参照.

重要でかつ再現性のあるバグを見つけた場合は マニュアルのバグ報告方法の項にあるルールに従って bugs@lists.mysql.com宛てにメールを送ってください。 バグの重要性に関わらず可能な限り迅速に対応いたします。

Basic e-mail support includes the following types of service:

基本電子メールサポートは以下のサービスを含みます:

1.3.5.2 Extended E-mail Support 拡張電子メールサポート

Extended e-mail support includes everything in basic e-mail support with these additions:

1.3.5.3 Login Support

Login support includes everything in extended e-mail support with these additions:

1.3.5.4 Extended Login Support

Extended login support includes everything in login support with these additions:

1.3.5.5 Telephone Support

Telephone support includes everything in extended login support with these additions:

1.3.5.6 Support for other table handlers

To get support for BDB tables, InnoDB tables you have to pay an additional 30% on the standard support price for each of the table handlers you would like to have support for.

We at MySQL AB will help you create a proper bug report for the table handler and submit it to the developers for the specific table handler. We will also do our best to ensure that you will get a timely answer or solution from the developers of the table handler.

Even if we are quite confident that we can solve most problems within a timely manner, we can't guarantee a quick solution for any problems you can get with the different table handlers. We will however do our best to help you get the problem solved.

1.4 MySQL はどのように標準互換か?

この章では、MySQL がどのように ANSI SQL 標準に関係するかを説明し ます。MySQL は ANSI SQL 標準に対して多くの拡張を持ちます。そして、 ここでそれらが何か、またそれらの使用方法を見つけられるでしょう。また、 MySQL に足りない機能についての情報と、いくつかの違いを回避する方 法も見つけられるでしょう。

1.4.1 MySQL の ANSI SQL92 に対する拡張

MySQL は、他の SQL データベース内に見られないであろう、いくつか の拡張を含んでいます。あなたがそれらを使用する場合、コードは他の SQL サー バに移行できなくなるので注意してください。いくつかのケースでは、形式 /*! ... */ のコメントを使用することで、MySQL 拡張を含む 移行可能コードを書くことができます。この場合、MySQL はコメント 内のコードを実行しますが、ほかのSQLサーバーはこれを無視します。例えば:

SELECT /*! STRAIGHT_JOIN */ col_name FROM table1,table2 WHERE ...

'!' の後ろにバージョン番号を追加すると、文法は MySQL バー ジョンが使用されるバージョン番号と等しいか大きい場合にのみ実行されます:

CREATE /*!32302 TEMPORARY */ TABLE (a int);

上記は バージョン 3.23.02 かそれ以上の場合という意味で、そのとき MySQLTEMPORARY キーワードを使用します。

MySQL 拡張を以下に示します:

1.4.2 MySQL と ANSI SQL92 との違い

我々は MySQL を ANSI SQL 標準と ODBC SQL 標準に従うように試みてい ますが、いくつかのケースで MySQL は何か違いがあります:

1.4.3 ANSI モードでの MySQL の実行

--ansi オプションつきで mysqld を開始すると、その MySQL の 振舞いが変わります。

This is the same as using --sql-mode=REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,SERIALIZE,ONLY_FULL_GROUP_BY.

1.4.4 MySQL に無い機能

次の機能が MySQL の現在のバージョンにはありません。新しい拡張の 優先度については、次を参考にしてください the online MySQL TODO list. これはこのマニュアル中の TODO リストの最新バージョンです。 「1.6 MySQL and the future (The TODO)」節参照。

1.4.4.1 Sub-selects

MySQL currently only supports sub selects of the form INSERT ... SELECT ... and REPLACE ... SELECT .... You can however use the function IN() in other contexts.

しかし多くの場合、sub-select を使わないクエリに書き直すことができます:

SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);

This can be re-written as:

SELECT table1.* FROM table1,table2 WHERE table1.id=table2.id;

The queries:

SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
SELECT * FROM table1 WHERE NOT EXISTS (SELECT id FROM table2 where table1.id=table2.id);

Can be rewritten as:

SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id where table2.id IS NULL

さらに複雑なサブクエリでは、サブクエリを保持するために一時テーブルを作成で きます。しかし、この方法でも動かない場合があります。このケースには、 DELETE ステートメントでもっとも頻繁に遭遇します。DELETE ステー トメントでは、標準 SQL では(sub select の中を除いて)join をサポートして いません。サブクエリが MySQL にサポートされるまで、この状況には2 つの選択肢があります。

最初の選択肢は、手続きプログラミング言語(Perl や PHP のような)を使用して、 SELECT クエリを発行して削除されるレコードのプライマリキーを獲得し、 それから DELETE ステートメント(DELETE FROM ... WHERE ... IN (key1, key2, ...))を構築するためにその値を使用することです。

二番目の選択肢は、対話型 SQL を使用し、DELETE ステートメントのセッ トを(標準 || オペレータの代わりに)MySQL 拡張 CONCAT() を使用して、自動的に組み立てることです。例えば:

SELECT CONCAT('DELETE FROM tab1 WHERE pkid = ', tab1.pkid, ';')
  FROM tab1, tab2
 WHERE tab1.col1 = tab2.col2;

このクエリをスクリプトファイル中に置き、入力を mysql コマンドライン インタプリタに切替え、その出力を二番目のインタプリタインスタンスにパイプし ます:

prompt> mysql --skip-column-names mydb < myscript.sql | mysql mydb

MySQL 4.0 supports multi-table deletes that can be used to efficiently delete rows based on information from one table or even from many tables at the same time.

1.4.4.2 SELECT INTO TABLE

MySQL はまだ Oracle SQL extension: SELECT ... INTO TABLE ... をサポートしません。 MySQLINSERT INTO ... SELECT ... をサポートします。 これは基本的に同じことです。 「6.4.2.1 INSERT ... SELECT 構文」節参照.

INSERT INTO tblTemp2 (fldID) SELECT tblTemp1.fldOrder_ID FROM tblTemp1 WHERE
tblTemp1.fldOrder_ID > 100;

Alternatively, you can use SELECT INTO OUTFILE... or CREATE TABLE ... SELECT to solve your problem.

1.4.4.3 トランザクション

MySQL は現在トランザクションをサポートするため、次の議論は非トラ ンザクション安全テーブル型を使用する場合にだけ有効です。 「6.7.1 BEGIN/COMMIT/ROLLBACK 構文」節参照。

``なぜ MySQL はトランザクションのデータベースでないのか?'' とか ``なぜ MySQL はトランザクションをサポートしないのか?'' といった質問がしばしばなされます。

MySQL は、データの取り扱いに対し、他のパラダイム、 ``アトミック・オペレーション''をサポートする事を意図して決定しました。 アトミック・オペレーションが同等かあるいはより良いパフォーマンスを 提供するというのが、我々の経験、および考えです。 それでも、我々はトランザクション的データベースパラダイムとプランを評価し、 理解しています。次の数リリースのうちに、テーブル単位を基本に、トランザクショ ン安全テーブルを導入します。 その時我々は、ユーザーが、 スピード重視でアトミック・オペレーションを使用するのか、あるいは アプリケーションでトランザクションの機能を使うのか、 を、選択できるようにしようと考えています。

厳密に integrity 維持するには MySQL の機能をどのように使用するの でしょう? そして、トランザクション的パラダイムでこれらの機能をどのように 比較するのでしょう?

最初に、トランザクションのパラダイムでは、 もし、あなたのアプリケーションが 基本となる部分で ``commit'' の代わりに ``rollback'' の呼び出しに依存しているなら、 トランザクションはより便利になるでしょう。 おまけに、トランザクションは完了できなかった更新や不整合を起こした データが、確実にデータベースに登録されないようにできます。 そのサーバーには、自動的な rollback をする機会が与えられ、 あなたのデータは守られるでしょう。

MySQL はほとんどの場合、更新前の簡単なチェックを含ませることができたり、 あるいはデータベースの矛盾を検査して自動修復や警告の表示を行ったりする 簡単なスクリプトを実行することができるような、 ポテンシャルをあなたに提供します。 MySQL ログの使用や外部へのログの追加を行ったりする事で、 通常、データに不整合のおきたテーブルを完全に修復できることに注意してください。

さらに、``fatal'' transactional updates はアトミックで書き換えることができます。 実際、トランザクションが解決する全ての integrity problems は LOCK TABLES や atomic updates で置き換えることが出来、 さらにこれは、トランザクションのデータベースにある一般的な問題である、 データベースからの自動的な中断を得ること無しに、可能なはずです。

もしサーバーがダウンすればトランザクションでも全てを失うことを阻止できません。 この場合、トランザクションのシステムでもデータを全て失うでしょう。 The difference between different systems lies in just how small the time-lap is where they could lose data. No system is 100% secure, only ``secure enough.'' Even Oracle, reputed to be the safest of transactional databases, is reported to sometimes lose data in such situations.

MySQL を安全にするには、バックアップを取ることと、 更新ログを有効にすることだけです。 これで、あなたが他のトランザクションを持つデータベースで行っているような いかなる場面での修復が可能です。 もちろん、バックアップをとることは、どのデータベースを使用しているかに 関わらず、常に良いことです。

The transactional paradigm has its benefits and its drawbacks. Many users and application developers depend on the ease with which they can code around problems where an abort appears to be, or is necessary, and they may have to do a little more work with MySQL to either think differently or write more. If you are new to the atomic operations paradigm, or more familiar or more comfortable with transactions, do not jump to the conclusion that MySQL has not addressed these issues. Reliability and integrity are foremost in our minds. Recent estimates indicate that there are more than 1,000,000 mysqld servers currently running, many of which are in production environments. We hear very, very seldom from our users that they have lost any data, and in almost all of those cases user error is involved. This is, in our opinion, the best proof of MySQL's stability and reliability.

Lastly, in situations where integrity is of highest importance, MySQL's current features allow for transaction-level or better reliability and integrity. If you lock tables with LOCK TABLES, all updates will stall until any integrity checks are made. If you only obtain a read lock (as opposed to a write lock), then reads and inserts are still allowed to happen. The new inserted records will not be seen by any of the clients that have a READ lock until they release their read locks. With INSERT DELAYED you can queue inserts into a local queue, until the locks are released, without having the client wait for the insert to complete. 「6.4.3 INSERT DELAYED 構文」節参照.

``Atomic,'' in the sense that we mean it, is nothing magical. It only means that you can be sure that while each specific update is running, no other user can interfere with it, and there will never be an automatic rollback (which can happen on transaction based systems if you are not very careful). MySQL also guarantees that there will not be any dirty reads. You can find some example of how to write atomic updates in the commit-rollback section. 「1.4.6 COMMIT/ROLLBACK なしでうまくやる方法」節参照.

We have thought quite a bit about integrity and performance, and we believe that our atomic operations paradigm allows for both high reliability and extremely high performance, on the order of three to five times the speed of the fastest and most optimally tuned of transactional databases. We didn't leave out transactions because they are hard to do. The main reason we went with atomic operations as opposed to transactions is that by doing this we could apply many speed optimizations that would not otherwise have been possible.

Many of our users who have speed foremost in their minds are not at all concerned about transactions. For them transactions are not an issue. For those of our users who are concerned with or have wondered about transactions vis-a-vis MySQL, there is a ``MySQL way'' as we have outlined above. For those where safety is more important than speed, we recommend them to use the BDB, or InnoDB tables for all their critical data. 「7 MySQL テーブル型」節参照.

One final note: We are currently working on a safe replication schema that we believe to be better than any commercial replication system we know of. This system will work most reliably under the atomic operations, non-transactional, paradigm. Stay tuned.

1.4.4.4 ストアドプロシジャとトリガ

ストアドプロシジャは、サーバ内でコンパイルでき格納できる SQL コマンドの セットです。一度これが行なわれると、クライアントはクエリ全体の再発行を保 持する必要がなく、ストアドプロシジャを参照できます。これはさらにより速い速度を提 供します。クエリは一度だけ解釈され、より少ないデータがサーバとクライアン ト間で送信されるからです。サーバ内に関数ライブラリを持つことにより概念レ ベルを上げることもできます。

トリガは特別なイベントが発生した時に呼び出されるストアドプロシジャです。 例えば、トランザクションテーブルからレコードが削除される度にトリガされ、 トランザクションが削除された時に自動的に対応する顧客を顧客テーブルから削 除するというストアドプロシジャをインストールすることができます。

計画されている言語の更新はストアドプロシジャを処理できるようになりますが、 トリガは除きます。トリガは通常全てを、それらを必要としないクエリでさえも 遅くします。

MySQL がストアドプロシジャを得る時を知るには、 「1.6 MySQL and the future (The TODO)」節 を参照 してください。

1.4.4.5 外部キー

注意: SQL の外部キーはテーブルを結合するためには使用できませんが、指示の 完全性の検査のために良く使用されます(foreign key constraints)。 SELECT ステートメントで複数 テーブルから結果を得たい場合、テーブルの結合によってこれを行ないます:

SELECT * from table1,table2 where table1.id = table2.id;

6.4.1.1 JOIN 構文」節参照. 「3.5.6 Using Foreign Keys」節参照.

MySQL 内での FOREIGN KEY 構文は、他の SQL ベンダの CREATE TABLE コマンドとの互換のためだけに存在します; これは何も行 ないません。ON DELETE ... がない FOREIGN KEY 構文は、目的 の作成のために主に使われます。いくつかの ODBC アプリケーションは、自動的 に WHERE 節を提供するために、これを使用しますが、しかしこれは通常 簡単に無効にできます。FOREIGN KEY は時々強制チェックとして使用さ れます。しかし、テーブルに正しい順で行が挿入される場合、このチェックは実 際には不要です。いくつかのアプリケーションがそれが存在することを要求する ため MySQL はこれらの節だけをサポートします(それが動作するかど うかに関わらず)。

MySQL では、外部キーを持つテーブルからレコードを削除する時に適 切な DELETE ステートメントをアプリケーションに追加することで、 ON DELETE ... が実装されていないという問題を回避できます。実際に は、これは速く(いくつかの場合はより速く)そして外部キーの使用よりもさらに 可搬性があります。

近い将来、少なくとも情報が保存され、そして mysqldump と ODBC によっ て取り出されるように、我々は FOREIGN KEY 実装を拡張します。 At a later stage we will implement the foreign key constraints for application that can't easily be coded to avoid them.

1.4.4.6 外部キーを使用しない理由

我々がどこから始めるのかわからない FOREIGN KEY には多くの問題があ ります:

外部キーの良い面は、ODBC と他のいくつかのクライアントプログラムに、どの ようにテーブルが接続されるかを見る機能を与え、これを使用して接続図を示し、 生成アプリケーションの手助けをすることだけです。

MySQL は間もなく、クライアントがどのようにオリジナル接続が作成 されたかを問い合わせ、回答を受けられるように FOREIGN KEY 定義を格 納します。現在の `.frm' ファイル形式にはそれを置く場所はありません。

1.4.4.7 ビュー

MySQL はビューをサポートしません。 しかし 4.1 で組み込むことを考えています。

Views are mostly useful for letting users access a set of relations as one table (in read-only mode). Many SQL databases don't allow one to update any rows in a view, but you have to do the updates in the separate tables.

As MySQL is mostly used in applications and on web system where the application writer has full control on the database usage, most of our users haven't regarded views to be very important. (At least no one has been interested enough in this to be prepared to finance the implementation of views).

One doesn't need views in MySQL to restrict access to columns as MySQL has a very sophisticated privilege system. 「4.2 General Security Issues and the MySQL Access Privilege System」節参照.

1.4.4.8 コメント開始としての `--'

他のいくつかの SQL データベースは、`--' をコメントの開始のために使 用します。MySQL`#' をコメント開始文字とします。 mysql コマンドラインツールが `--' で始まる全ての行を削除した としてもです。MySQL では C コメントスタイル /* これはコメ ント */ も使用できます。 「6.1.5 コメント 構文」節参照。

MySQL バージョン 3.23.3 以上は `--' をサポートしません; この退化したコメントスタイルは、次のコードのように !payment! の payment の値を自動的に挿入するような何かを使用して自動的に生成される SQL クエリで多くの問題を引き起こすためです:

UPDATE tbl_name SET credit=credit-!payment!

payment の値が負の場合に何が起きると思いますか?

1--1 は正しい SQL なので、我々は `--' をコメント開始と見なす ことはひどいことだと思います。

しかし MySQL バージョン 3.23 では次を使用できます: 1-- これはコメント

以降の説明では、バージョン 3.23 よりも前の MySQL を実行している場 合だけが対象です:

テキストファイルの SQL プログラムが `--' コメントを含んでいる場合、 次を使用すべきです:

shell> replace " --" " #" < text-file-with-funny-comments.sql \
         | mysql database

通常の次の代わりに:

shell> mysql database < text-file-with-funny-comments.sql

次の方法でも、コマンドファイル中の `--' コメントを `#' コメン トに変更できます:

shell> replace " --" " #" -- text-file-with-funny-comments.sql

それらは次のコマンドで戻してください:

shell> replace " #" " --" -- text-file-with-funny-comments.sql

1.4.5 MySQL が準拠している標準

Entry level SQL92. ODBC levels 0-2.

1.4.6 COMMIT/ROLLBACK なしでうまくやる方法

以下は主に ISAM, MyISAM, HEAP テーブルだけにあてはま ります。更新にトランザクション安全なテーブル(BDB, InnoDB テー ブル)だけを使用している場合、MySQL でも COMMITROLLBACK を行なうことができます。 「6.7.1 BEGIN/COMMIT/ROLLBACK 構文」節参照。

上記のテーブル型で COMMIT-ROLLBACK を効率よく操作する上での 問題は、MySQL が今日使用しているのとは、まったく異なったテーブル レイアウトを要求することです。 この型のテーブルは、自動的にテーブルをクリーンアップする拡張スレッドも必要 とし、ディスク使用量はさらに大きくなります。 これは MySQL を現在 よりも 2〜4 倍遅くしてしまいます。

今、我々は SQL サーバ言語(ストアドプロシジャのようなもの)の実装にさらに 賛成です。これで、本当に COMMIT-ROLLBACK を必要とするのは めったにありません。これはさらに良い性能も与えるでしょう。

トランザクションを必要とするループは、通常は LOCK TABLES の助けで コード化でき、そして fly 上でレコードの更新時にはカーソルは必要としませ ん。

我々 TcX で本当に必要としているのは、100% 標準のデータベースではなくて、 本当に速いデータベースです。速度低下なしでそれらの機能を実装する方法を見つけた ときには、我々はそれを行なうでしょう。しばらくは行なうべきさらに重要なこ とが多くあります。今の我々の優先度については TODO をチェックしてください。 高レベルのサポートを持つ顧客はこれを変えることができ、再び優先順位づけが 行なわれます。

現在の問題は実際には ROLLBACK です。ROLLBACK なしでも LOCK TABLESCOMMIT アクションのいくつかの種類を行なうこ とができます。ROLLBACK をサポートするためには、更新される全ての古 いレコードを格納し、ROLLBACK が発行された場合に開始位置に全てを戻 すように、MySQL を変更しなければなりません。単純な場合には、こ れを行なうには難しくありません(現在の isamlog をこの目的に使用し ます)。しかし、ALTER/DROP/CREATE TABLE での ROLLBACK の実 装を行うことはとても困難です。

ROLLBACK の使用の回避のために、次の方法を使用することができます:

  1. LOCK TABLES ... をアクセスしたいテーブルの全てをロックするために 使用します
  2. 条件のテスト。
  3. 全て OK なら更新。
  4. UNLOCK TABLES をロックの解除に使用します

これは普通は ROLLBACK 可能なトランザクションの使用よりも速いです が、常にではありません。この解が処理できない状況は、更新中に誰かがスレッ ドを kill する時だけです。この場合、全てのロックはリリースされますが、い くつかの更新は実行されません。

1回のオペレーション中でレコードを更新する関数も使用できます。次のテクニック によってとても効率的なアプリケーションを得ることができます。

例えば、いくつかの顧客情報で更新を行なっている時、我々は変更された顧客デー タだけを更新し、変更されていないデータはテストせず、変更されたデータに依 存して変更されたデータがオリジナルの行と比較されます。変更のテストは UPDATE ステートメント内の WHERE 節で行われます。レコードが 更新されなかった時は、我々はクライアントにメッセージ: "Some of the data you have changed has been changed by another user" を与え、そしてそれか ら古い行と新しい行をウィンドウ内で表示します。ユーザは顧客レコードのどち らのバージョンを使用すべきかを決定できます。

これは column locking に似たものを我々に与えますが、実際には十分です。 なぜなら、我々はそれらの現在の値に関連した値を持つフィールドだけを更新するから です。これは、典型的な UPDATE ステートメントが次のように見えると いうことを意味します:

UPDATE tablename SET pay_back=pay_back+'relative change';

UPDATE customer
  SET
    customer_date='current_date',
    address='new address',
    phone='new phone',
    money_he_owes_us=money_he_owes_us+'new_money'
  WHERE
    customer_id=id AND address='old address' AND phone='old phone';

見ての通り、他のクライアントが pay_back または money_he_owes_us フィールドの値を変更したとしても、これはとても効率的で 働きます。

多くの場合、ユーザは ROLLBACK そして/または LOCK TABLES が いくつかのテーブルでユニークな識別子を管理することを望みます。これは、 AUTO_INCREMENT フィールドと SQL LAST_INSERT_ID() 関数や C API 関 数 mysql_insert_id の使用によって、さらに効率的に処理できます。 「8.4.3.126 mysql_insert_id()」節参照.

MySQL AB では、我々はいつでもそれを回避してコード可能なので、 我々は行レベルロックを必要としていません。本当に行ロックを必要とする ケースもありますが、しかしこれは非常にまれです。 行レベルロックを望むのなら、テーブル内でフラグ項目を使用して、 次のようにして行なえます:

UPDATE tbl_name SET row_flag=1 WHERE id=ID;

行が見つかり、オリジナル行内で row_flag が既に 1 でない場合、 MySQL は影響された行数として 1 を返します。

MySQL が上述のクエリを次に変更したと考えることが可能です:

UPDATE tbl_name SET row_flag=1 WHERE id=ID and row_flag <> 1;

1.4.7 MySQL での既知のエラーと欠けているデザイン

The following problems are known and have a very high priority to get fixed:

The following problems are known and will be fixed in due time:

The following are known bugs in earlier versions of MySQL:

For platform-specific bugs, see the sections about compiling and porting.

1.5 How MySQL Compares to Other Databases

This section compares MySQL to other popular databases.

This section has been written by the MySQL developers, so it should be read with that in mind. There are no factual errors contained in this section that we know of. If you find something which you believe to be an error, please contact us about it at docs@mysql.com.

For a list of all supported limits, functions, and types, see the crash-me Web page at http://www.mysql.com/information/crash-me.php.

1.5.1 How MySQL Compares to mSQL

Performance
真の速度比較のためは、増加する MySQL ベンチマークスイートを見て下さい 「5.1.4 The MySQL Benchmark Suite」節参照. Because there is no thread creation overhead, a small parser, few features, and simple security, mSQL should be quicker at: これらのオペレーションはとても単純なので、開始のオーバーヘッドが高くなる 時にそれらを良くするのは難しいです。接続が確立された後は MySQL はとても良い性能になります。 他のものでは MySQLmSQL や多くの他の SQL 実装よりとて も速いです:
SQL Features
Disk Space Efficiency
これは、テーブルをどのように小さくできるかです。 MySQL はとても精密な型を持ちます。とても小さい領域を使用するテーブルを作成でき るためです。MySQL データ型の有用な例は、3バイト長の MEDIUMINT です。10,000,000 レコードを持つ場合、1レコードあたり1バイトの節約でもと ても重要です。 mSQL2 は4つの型(char,text,int,real)しかないので、小さなテーブルを 得るのは難しいです。
安定性
これを客観的に判断するのは難しいです。MySQL の安定性については 「1.1.7 MySQL はどれくらい安定か?」節 を参照してください。 我々には mSQL 安定性の経験がありません。そのため、我々はこれにつ いては何も言えません。
価格
もう一つの重要な問題はもちろんライセンスです。MySQLmSQL よりも柔軟なライセンスを持っています。そして mSQL よ りもより安いです。少なくとも、あなたが使用を選択した製品全てに、ライセン スまたは email サポートへの支払いを考慮することを覚えていて下さい。 MySQL を含めた製品を売る場合、もちろんこのライセンスの獲得が要求 されます。
Perl Interfaces
MySQL は基本的に mSQL と同じ perl インタフェースと、いくつかの追 加機能を持ちます。
JDBC (Java)
MySQL currently has a lot of different JDBC drivers: The recommended driver is the mm driver. The Resin driver may also be good (at least the benchmarks looks good), but we haven't received that much information about this yet. We know that mSQL has a JDBC driver, but we have too little experience with it to compare.
開発の速度
MySQL はとても小さい開発チームを持っていますが、我々は C と C++ のコーディ ングをとても速く行ないます。スレッド、関数、 GROUP BY などはまだ mSQL には実装されていませんので、it has a lot of chatching up to do. この上でいくつかの見通しを得るために、去年の mSQL `HISTORY' ファ イルを見て、MySQL Reference Manual News 節と比較できます( 「F MySQL change history」節)。 速く開発された多くのものが、かなり明白になります。
ユーティリティプログラム
mSQLMySQL は多くの興味深いサードパーティツールを持っ ています。上位への移行 (mSQL -> MySQL) はとても簡単です。 MySQL は、ほとんど全ての興味深い mSQL アプリケーションを 持っています。 MySQL には、簡単な msql2mysql プログラムが用意されています。 これは、mSQLMySQL の C API 関数のスペルの違いを修正するプログラムです。 For example, it changes instances of msqlConnect() to mysql_connect(). mSQL から MySQL への変換は通常、数分使用するだけです。

1.5.1.1 How to Convert mSQL Tools for MySQL

According to our experience, it would just take a few hours to convert tools such as msql-tcl and msqljava that use the mSQL C API so that they work with the MySQL C API.

The conversion procedure is:

  1. シェルスクリプト msql2mysql をソースに実行します。バイナリプログラム replace が必要です。これは MySQL で配布されます。
  2. Compile.
  3. 全てのコンパイラエラーを修復します.

MySQLmSQL 間の C API の違い:

1.5.1.2 How mSQL and MySQL Client/Server Communications Protocols Differ

There are enough differences that it is impossible (or at least not easy) to support both.

The most significant ways in which the MySQL protocol differs from the mSQL protocol are listed below:

1.5.1.3 How mSQL 2.0 SQL Syntax Differs from MySQL

Column types

MySQL
Has the following additional types (among others; 「6.5.3 CREATE TABLE 構文」節):
MySQL also supports the following additional type attributes:
mSQL2
mSQL column types correspond to the MySQL types shown below:
mSQL type Corresponding MySQL type
CHAR(len) CHAR(len)
TEXT(len) TEXT(len). len is the maximal length. And LIKE works.
INT INT. With many more options!
REAL REAL. Or FLOAT. Both 4- and 8-byte versions are available.
UINT INT UNSIGNED
DATE DATE. Uses ANSI SQL format rather than mSQL's own format.
TIME TIME
MONEY DECIMAL(12,2). A fixed-point value with two decimals.

Index Creation

MySQL
Indexes may be specified at table creation time with the CREATE TABLE statement.
mSQL
Indexes must be created after the table has been created, with separate CREATE INDEX statements.

To Insert a Unique Identifier into a Table

MySQL
Use AUTO_INCREMENT as a column type specifier. 「8.4.3.126 mysql_insert_id()」節参照.
mSQL
Create a SEQUENCE on a table and select the _seq column.

To Obtain a Unique Identifier for a Row

MySQL
Add a PRIMARY KEY or UNIQUE key to the table and use this. New in Version 3.23.11: If the PRIMARY or UNIQUE key consists of only one column and this is of type integer, one can also refer to it as _rowid.
mSQL
Use the _rowid column. Observe that _rowid may change over time depending on many factors.

To Get the Time a Column Was Last Modified

MySQL
Add a TIMESTAMP column to the table. This column is automatically set to the current date and time for INSERT or UPDATE statements if you don't give the column a value or if you give it a NULL value.
mSQL
Use the _timestamp column.

NULL Value Comparisons

MySQL
MySQL follows ANSI SQL, and a comparison with NULL is always NULL.
mSQL
In mSQL, NULL = NULL is TRUE. You must change =NULL to IS NULL and <>NULL to IS NOT NULL when porting old code from mSQL to MySQL.

String Comparisons

MySQL
Normally, string comparisons are performed in case-independent fashion with the sort order determined by the current character set (ISO-8859-1 Latin1 by default). If you don't like this, declare your columns with the BINARY attribute, which causes comparisons to be done according to the ASCII order used on the MySQL server host.
mSQL
All string comparisons are performed in case-sensitive fashion with sorting in ASCII order.

Case-insensitive Searching

MySQL
LIKE is a case-insensitive or case-sensitive operator, depending on the columns involved. If possible, MySQL uses indexes if the LIKE argument doesn't start with a wild-card character.
mSQL
Use CLIKE.

Handling of Trailing Spaces

MySQL
Strips all spaces at the end of CHAR and VARCHAR columns. Use a TEXT column if this behavior is not desired.
mSQL
Retains trailing space.

WHERE Clauses

MySQL
MySQL correctly prioritizes everything (AND is evaluated before OR). To get mSQL behavior in MySQL, use parentheses (as shown in an example below).
mSQL
Evaluates everything from left to right. This means that some logical calculations with more than three arguments cannot be expressed in any way. It also means you must change some queries when you upgrade to MySQL. You do this easily by adding parentheses. Suppose you have the following mSQL query:
mysql> SELECT * FROM table WHERE a=1 AND b=2 OR a=3 AND b=4;
To make MySQL evaluate this the way that mSQL would, you must add parentheses:
mysql> SELECT * FROM table WHERE (a=1 AND (b=2 OR (a=3 AND (b=4))));

Access Control

MySQL
Has tables to store grant (permission) options per user, host, and database. 「4.2.5 特権システムはどのように動くか?」節参照.
mSQL
Has a file `mSQL.acl' in which you can grant read/write privileges for users.

1.5.2 How MySQL Compares to PostgreSQL

When reading the following, please note that both products are continually evolving. We at MySQL AB and the PostgreSQL developers are both working on making our respective database as good as possible, so we are both a serious choice to any commercial database.

The following comparison is made by us at MySQL AB. We have tried to be as accurate and fair as possible, but because we don't have a full knowledge of all PostgreSQL features while we know MySQL througly, we may have got some things wrong. We will however correct these when they come to our attention.

We would first like to note that PostgreSQL and MySQL are both widely used products, but with different design goals, even if we are both striving to be ANSI SQL compatible. This means that for some applications MySQL is more suited, while for others PostgreSQL is more suited. When choosing which database to use, you should first check if the database's feature set satisfies your application. If you need raw speed, MySQL is probably your best choice. If you need some of the extra features that only PostgreSQL can offer, you should use PostgreSQL.

1.5.2.1 MySQL and PostgreSQL development strategies

When adding things to MySQL we take pride to do an optimal, definite solution. The code should be so good that we shouldn't have any need to change it in the foreseeable future. We also do not like to sacrifice speed for features but instead will do our utmost to find a solution that will give maximal throughput. This means that development will take a little longer, but the end result will be well worth this. This kind of development is only possible because all server code are checked by one of a few (currently two) persons before it's included in the MySQL server.

We at MySQL AB believe in frequent releases to be able to push out new features quickly to our users. Because of this we do a new small release about every three weeks, and a major branch every year. All releases are throughly tested with our testing tools on a lot of different platforms.

PostgreSQL is based on a kernel with lots of contributors. In this setup it makes sense to prioritize adding a lot of new features, instead of implementing them optimally, because one can always optimize things later if there arises a need for this.

Another big difference between MySQL and PostgreSQL is that nearly all of the code in the MySQL server are coded by developers that are employed by MySQL AB and are still working on the server code. The exceptions are the transaction engines, and the regexp library.

This is in sharp contrast to the PostgreSQL code where the majority of the code is coded by a big group of people with different backgrounds. It was only recently that the PostgreSQL developers announced that their current developer group had finally had time to take a look at all the code in the current PostgreSQL release.

Both of the above development methods has it's own merits and drawbacks. We here at MySQL AB think of course that our model is better because our model gives better code consistency, more optimal and reusable code, and in our opinion, fewer bugs. Because we are the authors of the MySQL server code, we are better able to coordinate new features and releases.

1.5.2.2 Featurewise Comparison of MySQL and PostgreSQL

On the crash-me page you can find a list of those database constructs and limits that one can detect automatically with a program. Note however that a lot of the numerical limits may be changed with startup options for respective database. The above web page is however extremely useful when you want to ensure that your applications works with many different databases or when you want to convert your application from one datbase to another.

MySQL offers the following advantages over PostgreSQL:

Drawbacks with MySQL compared to PostgreSQL:

PostgreSQL currently offers the following advantages over MySQL:

Note that because we know the MySQL road map, we have included in the following table the version when MySQL should support this feature. Unfortunately we couldn't do this for previous comparison, because we don't know the PostgreSQL roadmap.

Feature MySQL version
Subselects 4.1
Foreign keys 4.0 and 4.1
Views 4.2
Stored procedures 4.1
Extensible type system Not planned
Unions 4.0
Full join 4.0 or 4.1
Triggers 4.1
Constrainst 4.1
Cursors 4.1 or 4.2
Extensible index types like R-trees R-trees are planned for 4.2
Inherited tables Not planned

Other reasons to use PostgreSQL:

Drawbacks with PostgreSQL compared to MySQL:

For a complete list of drawbacks, you should also examine the first table in this section.

1.5.2.3 Benchmarking MySQL and PostgreSQL

The only open source benchmark that we know of that can be used to benchmark MySQL and PostgreSQL (and other databases) is our own. It can be found at http://www.mysql.com/information/benchmarks.html.

We have many times asked the PostgreSQL developers and some PostgreSQL users to help us extend this benchmark to make it the definitive benchmark for databases, but unfortunately we haven't gotten any feedback for this.

We the MySQL developers have, because of this, spent a lot of hours to get maximum performance from PostgreSQL for the benchmarks, but because we don't know PostgreSQL intimately, we are sure that there are things that we have missed. We have on the benchmark page documented exactly how we did run the benchmark so that it should be easy for anyone to repeat and verify our results.

The benchmarks are usually run with and without the --fast option. When run with --fast we are trying to use every trick the server can do to get the code to execute as fast as possible. The idea is that the normal run should show how the server would work in a default setup and the --fast run shows how the server would do if the application developer would use extensions in the server to make his application run faster.

When running with PostgreSQL and --fast we do a VACUUM() after every major table UPDATE and DROP TABLE to make the database in perfect shape for the following SELECTs. The time for VACUUM() is measured separately.

When running with PostgreSQL 7.1.1 we could, however, not run with --fast because during the INSERT test, the postmaster (the PostgreSQL deamon) died and the database was so corrupted that it was impossible to restart postmaster. After this happened twice, we decided to postpone the --fast test until next PostgreSQL release. The details about the machine we run the benchmark can be found on the benchmark page.

Before going to the other benchmarks we know of, we would like to give some background on benchmarks:

It's very easy to write a test that shows ANY database to be best database in the world, by just restricting the test to something the database is very good at and not test anything that the database is not good at. If one after this publishes the result with a single figure, things are even easier.

This would be like us measuring the speed of MySQL compared to PostgreSQL by looking at the summary time of the MySQL benchmarks on our web page. Based on this MySQL would be more than 40 times faster than PostgreSQL, something that is of course not true. We could make things even worse by just taking the test where PostgreSQL performs worst and claim that MySQL is more than 2000 times faster than PostgreSQL.

The case is that MySQL does a lot of optimizations that PostgreSQL doesn't do. This is of course also true the other way around. An SQL optimizer is a very complex thing, and a company could spend years on just making the optimizer faster and faster.

When looking at the benchmark results you should look for things that you do in your application and just use these results to decide which database would be best suited for your application. The benchmark results also shows things a particular database is not good at and should give you a notion about things to avoid and what you may have to do in other ways.

We know of two benchmark tests that claims that PostgreSQL performs better than MySQL. These both where multi-user tests, a test that we here at MySQL AB haven't had time to write and include in the benchmark suite, mainly because it's a big task to do this in a manner that is fair against all databases.

One is the benchmark paid for by Great Bridge, which you can read about at: http://www.greatbridge.com/about/press.php?content_id=4.

This is the probably worst benchmark we have ever seen anyone conduct. This was not only tuned to only test what PostgreSQL is absolutely best at, it was also totally unfair against every other database involved in the test.

NOTE: We know that not even some of the main PostgreSQL developers did like the way Great Bridge conducted the benchmark, so we don't blame them for the way the benchmark was made.

This benchmark has been condemned in a lot of postings and newsgroups so we will here just shortly repeat some things that where wrong with it.

Tim Perdue, a long time PostgreSQL fan and a reluctant MySQL user published a comparison on phpbuider.

When we became aware of the comparison, we phoned Tim Perdue about this because there were a lot of strange things in his results. For example, he claimed that MySQL had a problem with five users in his tests, when we know that there are users with similar machines as his that are using MySQL with 2000 simultaneous connections doing 400 queries per second. (In this case the limit was the web bandwidth, not the database.)

It sounded like he was using a Linux kernel that either had some problems with many threads, such as kernels before 2.4, which had a problem with many threads on multi-CPU machines. We have documented in this manual how to fix this and Tim should be aware of this problem.

The other possible problem could have been an old glibc library and that Tim didn't use a MySQL binary from our site, which is linked with a corrected glibc library, but had compiled a version of his own with. In any of the above cases, the symptom would have been exactly what Tim had measured.

We asked Tim if we could get access to his data so that we could repeat the benchmark and if he could check the MySQL version on the machine to find out what was wrong and he promised to come back to us about this. He has not done that yet.

Because of this we can't put any trust in this benchmark either :(

Over time things also changes and the above benchmarks are not that relevant anymore. MySQL now have a couple of different table handlers with different speed/concurrency tradeoffs. 「7 MySQL テーブル型」節参照. It would be interesting to see how the above tests would run with the different transactional table types in MySQL. PostgreSQL has of course also got new features since the test was made. As the above test are not publicly available there is no way for us to know how the database would preform in the same tests today.

Conclusion:

The only benchmarks that exist today that anyone can download and run against MySQL and PostgreSQL is the MySQL benchmarks. We here at MySQL believe that open source databases should be tested with open source tools! This is the only way to ensure that no one does tests that nobody can reproduce and use this to claim that a database is better than another. Without knowing all the facts it's impossible to answer the claims of the tester.

The thing we find strange is that every test we have seen about PostgreSQL, that is impossible to reproduce, claims that PostgreSQL is better in most cases while our tests, which anyone can reproduce, clearly shows otherwise. With this we don't want to say that PostgreSQL isn't good at many things (it is!) or that it isn't faster than MySQL under certain conditions. We would just like to see a fair test where they are very good so that we could get some friendly competition going!

For more information about our benchmarks suite 「5.1.4 The MySQL Benchmark Suite」節参照.

We are working on an even better benchmark suite, including multi user tests, and a better documentation of what the individual tests really do and how to add more tests to the suite.

1.6 MySQL and the future (The TODO)

このリストのすべては、それが終わるだろう順番に書かれています。

もしあなたが優先順位に影響を及ぼしたければ、どうかライセンスかサポート登録して、 我々にあなたがより速く欲しいものを言ってください。 「1.3 MySQL ライセンスとサポート」節参照.

The plan is that we in the future will support the full ANSI SQL99 standard, but with a lot of useful extensions. The challenge is to do this without sacrifying the speed or compromise the code.

1.6.1 Things that should be in 4.0

We plan to make MySQL Version 4.0 a ``quick'' release where we only add some new stuff to enable others to help us with developing new features into Version 4.1. The MySQL 4.0 version should only take us about a month to make after which we want to stabilize it and start working on Version 4.1. Version 4.0 should have the following new features:

The news section for 4.0 includes a list of the features we have already implemented in the 4.0 tree. 「F.1 Changes in release 4.0.x (Development; Alpha)」節参照.

1.6.2 近い将来に完了せねばならないもの

1.6.3 いつかは行うべきもの

Time is given according to amount of work, not real time.

1.6.4 行う予定のない物


Go to the first, previous, next, last section, table of contents.