牌語備忘録 -pygo

あくまでもメモです。なるべくオフィシャルの情報を参照してください。

牌語備忘録 -pygo

MacOSX に MacPorts で Mysql5.6 をインストールするメモ

(macosx10.8, mysql5.6)

インストール

$ sudo port install mysql56
$ sudo port select --set mysql mysql56
$ sudo port install mysql56-server

出力

--->  Computing dependencies for mysql56-server
--->  Fetching archive for mysql56-server
--->  Attempting to fetch mysql56-server-5.6.15_0.darwin_12.noarch.tbz2 from http://jog.id.packages.macports.org/macports/packages/mysql56-server
--->  Attempting to fetch mysql56-server-5.6.15_0.darwin_12.noarch.tbz2.rmd160 from http://jog.id.packages.macports.org/macports/packages/mysql56-server
--->  Installing mysql56-server @5.6.15_0
--->  Activating mysql56-server @5.6.15_0

If this is a new install you might want to run:
$ sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db

--->  Cleaning mysql56-server
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

初期化

$ sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db

出力

o start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /opt/local/lib/mysql56/bin/mysqladmin -u root password 'new-password'
  /opt/local/lib/mysql56/bin/mysqladmin -u root -h macbookpro2012.local password 'new-password'

Alternatively you can run:

  /opt/local/lib/mysql56/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd /opt/local ; /opt/local/lib/mysql56/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /opt/local/lib/mysql56/bin/mysqlbug script!

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Could not copy config file template /opt/local/share/mysql56/support-files/my-default.cnf to
$basedir/etc/mysql56/my.cnf, may not have access rights to do so.
You may want to copy the file manually, or create your own,
it will then be used by default by the server when you start it.
対話式に設定
$ /opt/local/lib/mysql56/bin/mysql_secure_installation

自動起動

$ sudo port load mysql56-server
確認
$ ps -ef | grep mysql
    0    74     1   0 Thu01PM ??         0:00.70 /opt/local/bin/daemondo --label=mysql55-server --start-cmd /opt/local/lib/mysql55/bin/mysqld --user=_mysql ; --pid=exec
   74    77    74   0 Thu01PM ??         0:38.59 /opt/local/lib/mysql55/bin/mysqld --user=_mysql
    0  2268     1   0  3:08PM ??         0:00.01 /opt/local/bin/daemondo --label=mysql56-server --start-cmd /opt/local/lib/mysql56/bin/mysqld --user=_mysql ; --pid=exec
   74  2269  2268   0  3:08PM ??         0:00.51 /opt/local/lib/mysql56/bin/m

古いバージョンが動いていたので解除する

自動起動解除
$ sudo port unload mysql55-server
$ ps -ef | grep mysql
    0  2268     1   0  3:08PM ??         0:00.02 /opt/local/bin/daemondo --label=mysql56-server --start-cmd /opt/local/lib/mysql56/bin/mysqld --user=_mysql ; --pid=exec
   74  2269  2268   0  3:08PM ??         0:00.53 /opt/local/lib/mysql56/bin/mysqld --user=_mysql
  501  2444 36441   0  3:18PM ttys011    0:00.00 grep mysql

my.conf

$ sudo emacs /opt/local/etc/mysql56/my.cnf
File Edit Options Buffers Tools Conf YASnippet Help
# Use default MacPorts settings
# !include /opt/local/etc/mysql56/macports-default.cnf
[mysqld]
innodb_ft_min_token_size = 2

[client]
port= 3306

[mysqld]
port= 3306

macports-default.cnf に skip-networking があるのでコメントアウト。(Sequel Pro を使えるようにするため)