MacPorts + MySQL

| | | Comments (0) | TrackBacks (0)

▼インストール

sudo port install mysql5 +server

▼my.cnf編集

sudo cp /opt/local/share/mysql5/mysql/my-medium.cnf /opt/local/etc/mysql5/my.cnf

InnoDBの設定をアンコメント

[mysqld]
default-character-set = utf8
default-storage-engine = innodb
skip-character-set-client-handshake

[mysql]
default-character-set = utf8

[mysqldump]
default-character-set = utf8

▼データベース初期化

sudo /opt/local/lib/mysql5/bin/mysql_install_db
sudo -u mysql mysql_install_db5

man mysql_install_db

you should either run mysql_install_db from the same account that will be used for running mysqld or run it as root and use the --user option to indicate the username that mysqld will run as.


▼デーモン登録

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

mysqladmin5 -u root password 'honyalala'


(再起動)
sudo launchctl stop org.macports.mysql5

▼パス

/opt/local/bin/以下のコマンドは全て/opt/local/lib/mysql5/binへのシンボリックリンクだけど,コマンド末にメジャーバージョン(5)がついているので(mysqladmin5など),/opt/local/lib/mysql5/binのほうを優先的にサーチするようにしておく.

▼CPANから足りないPerlモジュール追加

・DBD-mysql
 テスト時に'root'@'localhost' (using password: NO)でアクセスしようとするため,パスワードは一時的に消しておく.
 mysql> set password for root@localhost=password('');
 Query OK, 0 rows affected (0.00 sec)

・Data-ShowTable


0 TrackBacks

Listed below are links to blogs that reference this entry: MacPorts + MySQL.

TrackBack URL for this entry: http://storybook.jp/mtadmin/mt-tb.cgi/25

Leave a comment

About this Entry

This page contains a single entry by hidekaz published on April 10, 2008 10:12 PM.

Relation,メタrelation,メタメタ... was the previous entry in this blog.

DBDesigner4 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories