RDS の MySQL と Aurora では MySQL クライアントで接続する場合 環境 証明書ファイル SSL 接続を強要するデータベースユーザーを作成する 接続 参考 以上 RDS の MySQL と Aurora では デフォルトでクライアントからの SSL 接続が可能。 mysql> SHOW VARIABLES LIKE '%ssl%'; +---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
背景 自分はSIerのエンジニアである。 いろいろなお客様の、いろいろな業務システムと格闘するのがお仕事である。 また、今はembulk-input-jdbcとかembulk-output-jdbcのコミッタもやっている。 業務システムとRDBとテキストファイル 業務システムでは、たいていRDBを使っている。 そして、サーバ間でデータを連携するために、RDBからテキストファイルにエクスポートしたり、テキストファイルをRDBにインポートしたりすることが結構ある。 そんなときどうするかと言うと、RDB付属のツールを使うことが多い。 例えば、OracleへのインポートであればSQL*Loader、MySQLへのインポートであればmysqlimport、というように。 RDB付属のツールの問題点 いろいろなお客様がいて、いろいろなシステムがあるので、RDBもいろいろである。 ちなみに、うちの会社で
デッドロックとは、それぞれが他の必要なロックを保持しているために、異なるトランザクションを続行できない状況です。 両方のトランザクションがリソースが使用可能になるのを待機しているため、保持しているロックは解放されません。 デッドロックは、(UPDATE や SELECT ... FOR UPDATE などのステートメントを使用して) 複数のテーブルの行をトランザクションがロックするときに発生する可能性がありますが、逆の順序で発生します。 デッドロックは、このようなステートメントがインデックスレコードとギャップの範囲をロックし、各トランザクションが一部のロックを取得するけれども、タイミングの問題によりほかを取得しない場合にも発生することがあります。 デッドロックの例については、セクション15.7.5.1「InnoDB デッドロックの例」 を参照してください。 デッドロックの可能性を減らすには
以下のAntonioさんのblogで知ったのですが、先日リリースされたDB2 9.7 Fix Pack 2に面白い新機能が追加されていました。 - IBM releases DB2 Express-C 9.7.2 Support for the MySQL syntax for LIMIT and OFFSET. This greatly simplifies the process of getting existing applications to work with DB2. マニュアルにもまだ記載が無いと思うのですが、DB2 9.7 FP2にはMySQLやPostgreSQLのSELECT文で使用可能なLIMIT/OFFSET句が使えるようになっていました。 LIMITとOFFSETは、アンサーセットから中間の行を切り取って返す機能です。SQL標準では無いのですが、検索エンジンの
よくMySQLはサブクエリが弱いと言われるが、これは本当だろうか?半分は本当で半分は嘘である。MySQLのサブクエリだってなんでもかんでも遅いわけではない。落とし穴をしっかり避け、使いどころを間違えなければサブクエリも高速に実行できるのである。今日はMySQLがどんな風にサブクエリを実行し、どのような場合に遅いのかということについて説明しよう。 EXPLAINで実行計画を調べた際に、select_typeにはクエリの種類が表示されるのだが、代表的なサブクエリには次の3つのパターンがある。 SUBQUERY DEPENDENT SUBQUERY DERIVED 結論から言おう。遅いのは2番目、DEPENDENT SUBQUERYである。DEPENDENT SUBQUERYとはいわゆる相関サブクエリに相当するもので、サブクエリにおいて外部クエリのカラムを参照しているサブクエリのことである。そし
http://oshiete1.goo.ne.jp/kotaeru.php3?q=1069795 で質問した続きです。 うっかり詳細のテストをしてないのに締め切ってしまいました。 テーブルA 「member」 | id | name | テーブルB 「item」 | id | name | テーブルC 「item_check」 | member_id | item_id | というテーブルがあります。 テーブルAはメンバーで一人一つのデータが入っています。 テーブルBはメンバーが持つであろうアイテムのマスタです。 テーブルCはメンバーがどのアイテムを持っているかを示しているテーブルです。 テーブルCに関しては同じメンバーでも複数のアイテムを持つこともあるので複数のデータが入る場合もあります。 で、やろうとしているのは、 「アイテムA と アイテムBを持っているメンバー」 という検索を行いた
実は1.0.0が2010年12月にリリースされていたのに全く知名度の無い"MySQL Utilities"。実は便利な機能が複数用意されているので、スクリプトを手作りしなくても済む可能性大です。またリリースに向けて新たなマイルストーンリリースが出てきたMySQL 5.6でのレプリケーションの追加機能と組み合わせる便利機能もあります。 MySQL UtilitiesはPythonで書かれたスクリプト集で、MySQL Workbenchに同梱されて配布されています。ライセンスは「もちろん」GPLです。2012年7月上旬時点での最新版は1.0.5です。また実行可能なスクリプトの他に、ライブラリとして細かな機能が用意されているため、独自のスクリプト作成にも役立ちます。 起動にはMySQL Workbenchのメニューの【Plugins】から【Start Shell for MySQL Utilit
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
クラウドWebサービス時代は GUNDAM (Github Ubuntu Node Dropbox AWS MongDB) だ!! おい!おいおい!「LAMP経験者募集してます」っておい!もう2012年だぞ!もっとナウい感じのがあるだろ!!クラウドWebサービス時代は GUNDAM(Github Ubuntu Node Dropbox AWS MongDB)だ!!「LAMP経験は?」「俺がGUNDAMだ!」— Wataru MIYAGUNIさん (@gongoZ) 3月 12, 2012 LAMP (Linux Apache MySQL Perl-PHP-Python)の次の技術の総称はGUNDAMという言葉としてjanos,num,lnnmなどあったようですが 今ひとつ普及しない感じがありました。 しかし"GUNDAM"という言葉は普及しそうですね(ネタ的にもいいので) LAMPという言
「DSAS for Social を支える技術」 というネタでadvent calendar に挑戦します。 methane です。 PDOで MySQL を使うときは、みなさん $stmt = $con->prepare("..."); して $stmt->execute($values); とかしてプリペアドステートメントを利用されていると思います。 実は、このプリペアドステートメント、パフォーマンス的にはあまり良くありません。1つのクエリを実行するために、プレースホルダ付きのクエリを投げた後に、それに値をバインドして実行するコマンドを投げるので、1回のクエリを実行するのに2往復の通信が必要になるのです。 プリペアドステートメントにはパフォーマンスの利点(同じクエリを何度も発行するときにDBサーバーがクエリの解析を繰り返さないでもすむ)というものと、SQLインジェクション対策になる(正
しわっす!DBA 兼オペレーションエンジニア兼タスクマネージャやってる riywo です。何のネタを書こうかなぁと考えたのですが、正直ネタを仕込む時間もなかったので僕がいつもやってることをさらっと紹介するということで勘弁して下さい>< MySQL がおかしい! 03:14 hidek: なんかエラー出まくってるんだけど! 03:14 zigorou: MySQL と通信してるとこっぽい 03:15 riywo: 見ます こんなやりとりは皆さん日常茶飯事ですよね?ね?ね?こんな時に、DB に責任を持つものとして真っ先に対応するのが僕らの仕事です。でも、じゃあ具体的にこのあと何をしましょう?既にサービスはエラーだらけで一刻を争う状態です。 (対応開始) まずはエラーメッセージ 今回の様な場合はアプリのエラーログにどばっと MySQL に関するエラーが出ているでしょう。まずはそれを見ることが始ま
MySQLのチューニングにおいて非常に重要となるメモリ(バッファ)関連のパラメータについて、 チューニングのポイント DSASのとあるDBサーバ(実メモリ4GB)の実際の設定値 をまとめてみます。 また、必要メモリの総量の計算や限界値を越えてないかチェックしてくれるスクリプトも紹介します。 是非、参考にしてみてください! まず最初に注意点を。 バッファには2つのタイプがあります。 グローバルバッファ スレッドバッファ グローバルバッファはmysqld全体でそのバッファが1つだけ確保されるもので、 これに対し、 スレッドバッファはスレッド(コネクション)ごとに確保されるものです。 チューニングの際にはグローバル/スレッドの違いを意識するようにしましょう。 なぜなら、スレッドバッファに多くのメモリを割り当てると、コネクションが増えたとたんにアッという間にメモリ不足になってしまうからです。 in
(2015年1月追記:これは現時点で約5年前に書いた記事です。各種パラメータは名称や仕様が変更されている可能性があるため、最新の情報を参考にしてください) MySQLのメモリの話を考えていたら何が何だか分からなくなってきたので、my.cnfでの設定に絡めてまとめてみようと思う。そもそも、MySQLサーバにおいてMySQLのプロセスがトータルで使用するメモリは、どれくらいに見積もっておけばいいだろうか。参考書やネット上では以下のような計算式が紹介されている。 max_connections x [スレッド領域用メモリ合計値] に、以下をプラス。 [グローバル領域用メモリ合計値] DB専用サーバの場合だとこの値をマシン搭載メモリの8〜9割くらいにする、と想定するのがひとつの指針となるようだ。しかし32bit版Linux OSの場合は2〜3GBまでの制限があるため、搭載メモリがそれ以上あったとし
Apache+PHP+MySQLのシステムを開発。 これこそWindowsよりUbuntuを使う方が色々いい。 実際のApache+PHP+MySQLの多くはLinuxで動いているからだ。 私はWeb系の作業が多いので,Windowsよりも作業効率がアップしている。 その理由: ・Ubuntu デスクトップ版でも,サーバソフトをインストール出来る。 ・UbuntuはLinuxである。 ・Ubuntuで WebサーバApacheやPHPやMySQLやPerlを動かすことは,Linuxで動かすことになる。 ・WebサーバApacheの多くはLinuxで動いている。PHPやMySQLもLinuxで動いているものが多い。 ・UbuntuでのWeb開発は,実際のWebサーバと同じ環境で出来る。 ・UbuntuはWindowsの代わりとして十分に使えるほど快適である。またハードウェア認識能力・対応がよ
べっ・・・別にソースコードなんて自分でコンパイルしないんだからねッ!!などと言わずにまず聞いていただきたい。30秒でMySQLのコンパイルが出来るというこの事実を。最近、細々とビルド時間の短縮に取り組んでいたのだが、正直ここまで爆速になるとは思わなかった。今日はビルド時間短縮のためのテクニックを紹介するので、是非皆さんも参考にして、快適ビルド生活を送って頂きたい!! 自己ベストは26.262秒マシンの状態や負荷の状況によって多少ビルドにかかる時間は前後してしまうのだが、これまでの自己ベストはなんと26.262秒。平均すると30秒ぐらい。以前は1分を切ることがなかったのだが、今ではなんとその半分でビルドが出来てしまう。これは純粋にmakeをするのにかかった時間であり、cmake(MySQL 5.5以降)やconfigure(MySQL 5.1以前)にかかる時間は除いてある。だがそれでも速い。
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く