http://musashi.sourceforge.jp/install_mac.html
setdocenc.sh を変更する
# Encoding for command help message (-h)
#helpEnc=ja-euc
#helpEnc=ja-sjis
helpEnc=ja-utf8
#helpEnc=en
# Default encoding for XML document
#xmlEnc=euc-jp
#xmlEnc=Shift_JIS
xmlEnc=UTF-8
と変更して下記のスクリプト実行
$ ./setdocenc.sh
$ ./configure
$ make
$ sudo make install ミリセカンドまでをはかりたいときの簡単なPHPの関数
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
where の中で、次のように指定します。結構便利です。
delete from テーブル名 where cast(cid as binary) like "N%";
コマンドラインから、MySQL のデータベースを作成するためのメモです。普段あまりやらないのでよく忘れます。
まず、データベース作成 utf8 でつくります。utf-8 とか書くと文句言われます。
create database hoge default character set utf8;
このデータベース用に一緒にユーザをつくることもできます。identified
GRANT 権限 ON DB名.テーブル名 TO ユーザ名 INDENTIFIED BY 'パスワード'
具体的には、
grant all privileges on hoge.* to hoge_test identified by 'hogepassword'
ユーザのみ作る場合こともできますけど、データベースと一緒ユーザは作ったほうが楽です。
insert into user(host,user,password) values('localhost','hoge_test',password('dummyPass');