— y2sunlight ,Since 2019-10-02 Ground Sunlight は「Windowsで作る - PHPプログラミングの開発環境」をテーマにしたサイトです。 オープンソースを利用している全ての人達に祝福を!
Section Navigation [Toggle] 7.5.9 InnoDB トランザクションモデルとロック7.5.9.1 InnoDB と SET ... TRANSACTION ISOLATION LEVEL ... 7.5.9.2 ロックを取得しない読み取り一貫性 7.5.9.3 ロックを取得する読み取り SELECT ... FOR UPDATE および SELECT ... LOCK IN SHARE MODE 7.5.9.4 ネクストキーロック: ファントムの問題の回避 7.5.9.5 InnoDB で各種 SQL ステートメントによって設定されるロック 7.5.9.6 デッドロックの検出とロールバック 7.5.9.7 InnoDB での読み取り一貫性の例 7.5.9.8 デッドロックの対処法 SQL-92 のトランザクション分離レベルに関する InnoDB のデ
登場人物 どりるび:SIer時代はDBチームにDBを任せ、その後はゆるふわKVSを使いつづけることでRDBとの戦いを避けてきた。罪深い。 あらすじ のっぴきならない事情で、一意制約がかけられないにも関わらずテーブルに同一のデータを存在させたくないってことがあった。 例示であり実際のコードや所属する団体とはアレです。 user カラムはid(AUTO_INCREMENTなプライマリキー)とscreen_nameとis_deleted screen_nameの重複したデータは作りたくないが、例外としてis_deleted=TrueなものはOK こんなかんじ ID screen_name is_deleted 1 ibusem False 2 d_osamu True 3 d_osamu True 4 d_osamu False で これだとアプリケーションレベルで存在チェックをかけた後にインサ
随分と更新が空いてしまったが、「優れたMySQL DBAを見分ける27+3の質問」に対する回答例(漢バージョン)を紹介しよう。実は質問を掲載した際「難しい!」というコメントが非常に多く、もう少し易しい質問にするべきだったかと思って次のように呟いてみたのだが・・・ 非常に心強くて安心した。さすがに日本を代表するMySQLのエキスパートである。出題のレベルは間違ってはいなかった!! そんなわけで、回答の方に移ろう。 MySQLのサーバープロセスはいくつある?ひとつ。mysqldはシングルプロセス・マルチスレッドモデルを採用しているので、"サーバー"プロセスはひとつである。多くの場合、Linuxなどでmysqldを動かす場合には、お供にmysqld_safeも常に動いていることが多いが、mysqld_safeはサーバーではなく、mysqldのためのラッパーであるので数には含めない。 rootユー
MySQLのInnoDBストレージエンジンは行ロックをサポートしています。しかしOracleと同じ感覚でアプリケーションを作っていると、思わぬところでデッドロックに出くわすことがあります。これはInnoDBのロック範囲がOracleよりも微妙に広いためです。 実際の例で確認してみましょう。 mysql> select * from t; +----+------+ | c1 | c2 | +----+------+ | 10 | a | | 15 | a | | 20 | a | | 25 | a | | 30 | a | | 35 | a | | 40 | a | | 45 | a | | 50 | a | +----+------+c1列は主キーになっています。1つめのセッションで以下のSQLを実行します。 mysql> set tx_isolation = 'repeatable-r
All of Percona’s open-source software products, in one place, to download as much or as little as you need.
$ /usr/local/mysql-5.0.67/bin/mysql_install_db Installing MySQL system tables... 080809 16:23:59 [Warning] option '': unsigned value 18446744073709551615 adjusted to 4294967295 080809 16:23:59 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 ERROR: 1136 Column count doesn't match value count at row 1 080809 16:23:59 [ERROR] Aborting 080809 16:23:59 [Note
CREATE TABLE テーブル名(カラム名 型,カラム名 型, ... INDEX(カラム名); または CREATE INDEX インデックス名 ON テーブル名(カラム名); または ALTER TABLE テーブル名 ADD INDEX インデックス名(カラム名); 検索するデータ量が多い場合など、検索対象のカラムにインデックスを作成しておきましょう。 インデックスを作成しないと、検索対象のカラムのデータを全部検索するため、データベースに負担がかかりすぎ落ちることもあります。 インデックスを作成しておけば、カラムに設定されたインデックスを検索するので、データベースの負担も軽減し、なおかつ検索効率がアップします。 主キーを設定したカラム名には、自動的にインデックスが作成されますので、あえて作成する必要はありません。 データベース作成時のCREATE TABLE文でインデックス作成
ソーシャルゲーム開発者なら知っておきたい MySQL INDEX + EXPLAIN入門 広く浅くを担当してます、ota です。 技術ブログ第一回から早速流用スライドで申し訳ありませんが、社内勉強会資料として作成した「MySQL INDEX + EXPLAIN入門」です。 当社でもソーシャルゲームの開発を行っていますが、このような大量のデータを使用する・クエリの速度が求められる場合にインデックスは大変重要です。 インデックスの有効な利用にはDB設計者だけではなくプログラマにもある程度の知識が最低限必要となりますが、インデックスについての初心者向け資料があまりないようです。 このスライドではプログラマに知っておいて欲しい以下の基本的な点をまとめました。 INDEXを使用する時に気をつけること WHERE句 !=、<>はインデックスが使用できない WHERE句の全てのANDにかかっていないイン
今回は、MySQLの高速化のメモ - @luke_silvia.diaryの方法に従ってクエリの高速化をした際に、MySQLのインデックスについて分かったことを書いておきます。 高速化対象のクエリ 今回高速化したいクエリは、以下のようなもの。 SELECT users.*, students.school, workers.school FROM users LEFT JOIN students ON users.id = students.user_id LEFT JOIN workers ON users.id = workers.user_id WHERE (users.status= 1 AND ((kind = 0 AND students.school = 'test') OR (kind = 1 AND workers.school = 'test'))) ORDER BY
今回のプロジェクトは萌えるプロジェクトだ。 という訳で、照合順序とは何か前から気になっていたので調べました。 今までは何の意識する事も無くデフォルトで使っていたので。。。 ちなみに何度も書きますがOSはCentOS5.4、MySQLは5.1.40です。 以下のMySQLのURLを参考に抜粋していきましょう。 MySQL :: MySQL 5.6 リファレンスマニュアル :: 10.1.1 一般の文字セットおよび照合順序 照合順序とは、その名の通り照合する順番の事なんですね。 で、国ごとで文字の扱いが異なるから一杯文字キャラクター定義されているという訳ですね。 何だそのまんまで簡単じゃん。 create database hogehoge default character set utf8; というように今回データベースはutf8を使うのでデフォルトだとutf8が使われてます。 SHOW
MacOSXにMySQLというオープンソースデータベースをインストールする方法を解説します。MySQLはブログシステムのMovable Type(ムーバブルタイプ)などでも使用できます。 ここでは.dmgのパッケージファイルをダウンロードしてインストールします。 最新のMySQLをダウンロードする MySQLの公式サイトから最新版のMySQLをダウンロードします。公式サイトは日本語版も用意されているのですが、ダウンロードページだけは英語です。 しかし、それほど難しくはありませんので妙に構える必要はありません。 下記のURLからダウンロードしたいパッケージの「Pick a mirror」リンクをクリックして選択します。MacOSXのバージョンごとに分かれていますので、使用しているOSのバージョンに合ったものを選択してください。 http://dev.mysql.com/downloads/m
想定していること † MySQL5.0 MySQLがすでに稼動中。レプリケーションの設定はしていない 今回MySQLをもう一台増やして2台構成とし、master、slaveの構成にする ※今回と状況が異なる場合は、MySQLのリファレンスマニュアルを読むといいです。 ↑ 1. レプリケーション用ユーザを作成する † レプリケーション用ユーザを作成する 作成するユーザーはスレーブがマスタのバイナリ ログを読み込むときに接続するユーザーとなる。 既存のユーザーでもレプリケーションは可能だが、ユーザ名とパスワードが master.info ファイル内にテキストで保存されるため、安全のためレプリケーションプロセスにだけ権限があるユーザを作成する 設定例(マスタのほうに設定) 192.168.23.0/24 内のネットワークで許可 ユーザー名:repl パスワード:slavepass mysql >
コンテンツへスキップ 無料で使える!HubSpotの顧客リストの活用法 無料のアンケート作成ツール 比較/まとめ 無料「Excel」 テンプレート 比較/まとめ 無料で使えるノートアプリ比較 (Evernote / OneNote / Google Keep) おすすめの無料Web会議システム5選 WebP Converter 徹底解説!初心者でも直ぐに使える HubSpot は、マーケティング、セールス、サービスのためのCRM(Continue reading 多くの人の声を聞くことで改善できることも多い 企業や団体など運営していContinue reading 就職・転職には必須となる履歴書・職務経歴書 これから就職活動をスタートContinue reading 便利なノートアプリで効率的な仕事をしよう いつの時代も仕事をしていてメContinue reading 近年、リモートワーク
[English] これは MySQL の Ruby API です。MySQL の C API とほぼ同等の機能があります。 ダウンロード RubyForge tmtm.org 必要なもの MySQL 5.0.67 Ruby 1.8.7, 1.9.1 これら以外でも make できるかもしれませんが、確認してません。 ライセンス このプログラムは Ruby ライセンス に従います。 インストール 次を実行してください。 % ruby extconf.rb または % ruby extconf.rb --with-mysql-dir=/usr/local/mysql または % ruby extconf.rb --with-mysql-config それから % make extconf.rb には次のオプションを指定できます。 --with-mysql-include=dir MySQL
Java で MySQL にアクセスするには、MySQL 用の JDBC のドライバが必要である。このドライバは MySQL のサイトから入手できる (MySQL Connector/J とあるので、安定版または最新バージョンをダウンロードする)。 MySQL® Connector/J ダウンロードしたものを解凍すると、mysql-connector-java-x.x.xx-bin.jar というファイルがあるはずなので、これを (Linux の場合は) $JAVA_HOME/jre/lib/ext にコピーする。ここに JAR ファイルを置いておく限り、このドライバ (JAR ファイル) に対する CLASSPATH は特に設定する必要はない。 以下はデータベース中の users テーブルから、name と password という 2つのフィールドを読み出す例である (MySQLJDB
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く