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です。
以上です。
こちらの記事を参考にしました。
Mac SublimeText3 Package Control導入
Package Control をインストール
「Ctrl + Shift + ` 」でコマンドライン表示
※本当のショートカットは「Ctrl + 」だが「
」はShift無しだと「@」なので
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)
認証付きプロキシの環境で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 でコマンドパレット表示
参考
Mac ダイアログをキーボードで選択したい
HomebrewでSublimeText3インストール
sublime-text3はβバージョン扱いだそうで、下記のようにしてインストールする
$ brew tap caskroom/homebrew-versions $ brew cask install sublime-text3
参考
~/.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
参考
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
再度ターミナルを起動