2010-10-07

『売上猫くん on MySQL』開発日記 - 番外13 - MySQL Workbenchの憂鬱(ほぼ私的メモ)

『売上猫くん on MySQL』の開発もようやく終盤戦に突入。いままでは root 権限を主に使用して開発をすすめてきたが、リリース版のテストを行うにあたり、できるだけリスクを伴わないユーザ権限を作成し、これによりテストを行わなければならない。

そこでユーザ・権限を“お手軽に”管理・変更できる筈の、MySQL Workbench の Server Administration 機能を使うことにしたが、実はこれが全く“お手軽”ではなかったという御笑いの一席。

MySQL Workbench Ver5.2.16 OSS Beta→5.2.28 CE へアップグレード
このアップグレードを行った途端、Object Browser に mysql / information_schema が表示されなくなる。 「なんかとんでもないことやったかなぁ…?」と思いつつも、 これは以下を見つけて解決。

Information_Schema and mysql databases not shown(http://bugs.mysql.com/bug.php?id=53154)

Please, check "Show Metadata Schemata" checkbox in the Query Editor group of the SQL Editor tab in the Workbench Preferences dialog box. Use Edit > Preferences... menu item to open it. Don't forget to click "Refresh all" in the Object Browser's context menu after that.

Server Administration機能を“リモートから使用するにはSSHサーバが必要
5.2.28CEへアップグレード直後、元々Connection登録してあったリモートサーバについては、SSHサーバが無くても、Server Administration 機能を使用できた(ここが不思議なところ)。 ところが新規にConnection登録したリモートサーバについては、SSHサーバがないとServer Administration 機能は利用できない。
ちなみに、元々あったConnectionについても、“Store in Vault...”ボタンで登録してあるパスワードを消去してしまうと、それ以降はリモート接続できなくなってしまった。

FreeSSHd=SSHサーバを入れる
そんなわけで、MySQLを積んだリモートサーバにSSHサーバを入れることにする。
Windowsでフリーで利用できるなSSHを探してみると、FreeSSHd (FreeSSHd.exeのダウンロード)というのが簡単・お手軽らしい。 インストール方法はここ
インストール時の注意は、
  • 「Shell」ととももに「SFTP」も選択すること。
  • SFTPのタブの「SFTP Home Path」にmy.iniが入っているボリュームを指定する。例えば、my.iniがEドライブに入っているなら、「E:\」と指定する。
New Server Instance でエラー
さて、準備完了となり、“New Server Instance”を実行。ところが途中で下図のエラーが発生する。


Operation failed: File %ProgramFiles%\MySQL\MySQL Server 5.1\my.ini doesn't exist

というエラーが出る。 例によってググり、下記のサイトを見つける。

参考URL:
Workbench doesn't autodetect my.ini properly if %programfiles% not on C:
The second thing which was wrong, was the path to the my.ini file in MySQL Workbench. I have changed it from C:\Programme\mysql\MySQL Server 5.1\my.ini to /Programme/mysql/MySQL Server 5.1/my.ini
OS Language small problem - Server Administration
...someone pointed out that I could ignore this error and continue. This is not obvious. The error message should probably say "Warning", not "Error" and it should indicate that you can specify the exact location in a later step.

つまり上図のエラーが出たら、構わず“Next”をクリック。続くダイアログで[Change Parameters]ボックスをチェックして“Next”。 次のウインドウで「my.ini」の場所を“...”ボタンをクリックして指定する。


次に“OK”して、以下、指示に従いつつ最後までいく。
尚、ここでmy.ini を正しく指定しなくても最後まで一応たどり着くが、その場合は、“Manage Import / Export” を実行した時に、「Workbench "AttributeError:NoneType object has no attribute parametervalues」というエラーが出てしまった。 これでとりあえずは、Server Administration 機能をリモートからも使用できるようになった。

ここでは略したがその他にもエラーが出て散々。またまた2日を潰してた。Workbenchもそうだが、MySQL 関連を動かすのはやはり大変だわ。

土屋


関連リンク:『売上猫くん on MySQL』開発日記の記事一覧

0 件のコメント: