Toconangoのブログ

プログラミングのユルフワ備忘録です。間違った記載等ありましたらご連絡頂けますと幸いです。

MySQL Workbench 'mysqldump Version Mismatch'

Workbenchでデータのエクスポートを行ったところ、下記のエラーが出ました。

解決方法をメモしておきます。

環境

エラーの内容

/Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump is version 5.7.9, but the MySQL Server to be dumped has version 10.0.17.
Because the version of mysqldump is older than the server, some features may not be backed up properly.
It is recommended you upgrade your local MySQL client programs, including mysqldump to a version equal to or newer than that of the target server.
The path to the dump tool must then be set in Preferences -> Administrator -> Path to mysqldump Tool:

ローカルのmysqldump Toolのバージョンがサーバーと合っていないことが原因のようです。

サーバーの version 10.0.17. ということで、ローカルにMariaDBをインストールします。(Homebrewを使っています。)

ローカルにMariaDBをインストール

$ brew install mariadb   

==> Downloading https://homebrew.bintray.com/bottles/mariadb-10.1.14.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mariadb-10.1.14.yosemite.bottle.tar.gz
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
    mysql -uroot

To have launchd start mariadb now and restart at login:
  brew services start mariadb
Or, if you don't want/need a background service you can just run:
  mysql.server start
==> Summary
🍺  /usr/local/Cellar/mariadb/10.1.14: 573 files, 131.6M

Workbenchのmysqldump Tool のパスを設定する

インストールが完了したら

MySQLWorkbench -> Preferences -> Administrator -> Path to mysqldump Tool:

に、

/usr/local/Cellar/mariadb/10.1.14/bin/mysqldump

と入力すればOKです。

以上です。

こちらの記事を参考にしました。

MySQL Workbench 6.3.5でData Exportに失敗する場合 – Subsonic Systems

Mac SublimeText3 Package Control導入

Package Control をインストール

「Ctrl + Shift + ` 」でコマンドライン表示

※本当のショートカットは「Ctrl + 」だが「」はShift無しだと「@」なので

こちらに記載されているスクリプトを入力して、Enter

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

f:id:toconango:20160617001213p:plain

認証付きプロキシの環境でPackage Controlを導入する場合

(参考) 認証付きプロキシの環境でPackage Controlを導入する方法 - Qiita

urllib.request.ProxyHandler()の引数でhttp・httpsのプロキシサーバー関連の設定を行う。

コマンド中の [username] [password] [proxy_server] [port] は、実行する環境に応じて書き換え。

import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler({"http": "http://[username]:[password]@[proxy_server]:[port]", "https": "https://[username]:[password]@[proxy_address]:[port]"})) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

コマンドパレットを表示

Command + Shift + P でコマンドパレット表示

参考

[tips][Sublime Text] Sublime Text 3をインストールしたらまずやること

Mac ダイアログをキーボードで選択したい

システム環境設定 > キーボード > ショートカット

下部の「すべてのコントロール」を選択

選択決定はEnterでなく、スペースキーでやるので注意

参考

え?意外と知らない!?Macのダイアログをキーボードだけで操作する設定とショートカット | 22Inc.ブログ

HomebrewでSublimeText3インストール

sublime-text3はβバージョン扱いだそうで、下記のようにしてインストールする

$ brew tap caskroom/homebrew-versions
$ brew cask install sublime-text3

参考

SublimeText3 導入 with homebrew / Git Part.4(完) - 炙り〆鯖+男山

~/.ssh/configでssh接続

~/.ssh/configを編集

# hogeサーバー
Host hoge
    HostName xxx.xxx.xxx.xxx
    Port 22
    User login-user-name
    IdentityFile ~/.ssh/keys/hoge.pem

パーミッションで下記のように怒られる場合は、keyファイルの権限を700にする

$ ssh hoge
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/username/.ssh/keys/hoge.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/username/.ssh/keys/hoge.pem
Permission denied (publickey).

以上の設定で、

$ ssh hoge

で接続できます

パーミッションについて

-rw-r--r--
-rwxrwxrwx

左から、ファイルタイプ、ユーザー権限、グループ権限、その他のユーザの権限

ファイルタイプの種類

- ファイル
d ディレクト
l シンボリックリンク

権限の種類

r read 読込み権
w write 書込み権
x exec 実行権
- 権限なし

権限を、ユーザーに全ての権限、グループとその他には実行権限以外をもたせたい場合は、

$ chmod 755 filename
4 read (読込権)
2 write (書込権)
1 exec (実行権)

ディレクトリの所有権を再帰的に変更する場合は、オプション -R を使います。

# chown -hR apache:apache /var/www/wordpress

参考

わかりやすいパーミッションの話

rwxr-xr-xって何?パーティション?Linuxの基本コマンド「ls」の見方

Linuxコマンド【 chown 】ファイルの所有者やグループを変更 - Linux入門 - Webkaru

macをzshに変更

インストールされているか確認

(標準でインストールされています)

$ zsh --version
zsh 5.0.5 (x86_64-apple-darwin14.0)

最新化

$ brew install zsh

使用可能なshell一覧/etc/shellsに、brewでインストールしたzsh/usr/local/bin/zshを追加

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/zsh

ログインシェルの確認

$ echo $SHELL
/bin/bash

zshに変更

$ chsh -s /usr/local/bin/zsh
Changing shell for Username.
Password for Username: 
chsh: no changes made

chsh: no changes madeと言われた場合、

システム環境設定から変更する

ユーザとグループ > (右クリックで)詳細オプション > 設定後、OKで完了

zshに変更したら、ターミナルを再起動後、ログインシェルの確認

$ echo $SHELL
/usr/local/bin/zsh

zshrcを編集

/Users/onoeiko/.zshrcをお好みで

.zshrcの設定を反映させる

$ source ~/.zshrc

再度ターミナルを起動