Snow LeopardにGitをインストール
MacPortsでインストールする場合のportnameを調べる
bash-3.2$ sudo port search git ...
何やらいっぱいでてきたが、git-core,cgitをインストールすることにした。
Mac Portsでのインストールオプション確認
bash-3.2$ sudo port variants git-core Password: git-core has the variants: bash_completion: Completion support for bash [+]doc: Install HTML and plaintext documentation gitweb: Install gitweb.cgi svn: Bi-directional subversion repository support
bash-completionとgitwebを付けることにする。
bash-3.2$ sudo port variants cgit cgit has no variants
インストール実施
以下、少し長くなるがログとして残すために画面の表示内容を記す。
bash-3.2$ sudo port install git-core +bash_completion +gitweb
-
-
- > Computing dependencies for git-core
- > Fetching bash-completion
- > Attempting to fetch bash-completion-1.1.tar.gz from http://distfiles.macports.org/bash-completion
- > Verifying checksum(s) for bash-completion
- > Extracting bash-completion
- > Applying patches to bash-completion
- > Configuring bash-completion
- > Building bash-completion
- > Staging bash-completion into destroot
- > Installing bash-completion @1.1_2
-
-
-
- > Activating bash-completion @1.1_2
- > Cleaning bash-completion
- > Fetching pkgconfig
- > Attempting to fetch pkg-config-0.23.tar.gz from http://distfiles.macports.org/pkgconfig
- > Verifying checksum(s) for pkgconfig
- > Extracting pkgconfig
- > Configuring pkgconfig
- > Building pkgconfig
- > Staging pkgconfig into destroot
- > Installing pkgconfig @0.23_1
- > Activating pkgconfig @0.23_1
- > Cleaning pkgconfig
- > Fetching curl
- > Attempting to fetch curl-7.19.6.tar.bz2 from http://www.execve.net/curl/
- > Verifying checksum(s) for curl
- > Extracting curl
- > Configuring curl
- > Building curl
- > Staging curl into destroot
- > Installing curl @7.19.6_0
- > Activating curl @7.19.6_0
- > Cleaning curl
- > Fetching expat
- > Attempting to fetch expat-2.0.1.tar.gz from http://nchc.dl.sourceforge.net/expat
- > Verifying checksum(s) for expat
- > Extracting expat
- > Configuring expat
- > Building expat
- > Staging expat into destroot
- > Installing expat @2.0.1_0
- > Activating expat @2.0.1_0
- > Cleaning expat
- > Fetching gperf
- > Attempting to fetch gperf-3.0.4.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gperf
- > Verifying checksum(s) for gperf
- > Extracting gperf
- > Configuring gperf
- > Building gperf
- > Staging gperf into destroot
- > Installing gperf @3.0.4_0
- > Activating gperf @3.0.4_0
- > Cleaning gperf
- > Fetching libiconv
- > Attempting to fetch libiconv-1.13.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/libiconv
- > Verifying checksum(s) for libiconv
- > Extracting libiconv
- > Applying patches to libiconv
- > Configuring libiconv
- > Building libiconv
- > Staging libiconv into destroot
- > Installing libiconv @1.13_0
- > Activating libiconv @1.13_0
- > Cleaning libiconv
- > Fetching perl5.8
- > Attempting to fetch perl-5.8.9.tar.bz2 from http://distfiles.macports.org/perl5.8
- > Verifying checksum(s) for perl5.8
- > Extracting perl5.8
- > Applying patches to perl5.8
- > Configuring perl5.8
- > Building perl5.8
- > Staging perl5.8 into destroot
- > Installing perl5.8 @5.8.9_3
- > Activating perl5.8 @5.8.9_3
- > Cleaning perl5.8
- > Fetching perl5
- > Verifying checksum(s) for perl5
- > Extracting perl5
- > Configuring perl5
- > Building perl5
- > Staging perl5 into destroot
- > Installing perl5 @5.8.9_0
- > Activating perl5 @5.8.9_0
- > Cleaning perl5
- > Fetching p5-error
- > Attempting to fetch Error-0.17015.tar.gz from ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Error
- > Verifying checksum(s) for p5-error
- > Extracting p5-error
- > Configuring p5-error
- > Building p5-error
- > Staging p5-error into destroot
- > Installing p5-error @0.17015_0
- > Activating p5-error @0.17015_0
- > Cleaning p5-error
- > Fetching gettext
- > Attempting to fetch gettext-0.17.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gettext
- > Verifying checksum(s) for gettext
- > Extracting gettext
- > Applying patches to gettext
- > Configuring gettext
- > Building gettext
- > Staging gettext into destroot
- > Installing gettext @0.17_4
- > Activating gettext @0.17_4
- > Cleaning gettext
- > Fetching popt
- > Attempting to fetch popt-1.15.tar.gz from http://distfiles.macports.org/popt
- > Verifying checksum(s) for popt
- > Extracting popt
- > Configuring popt
- > Building popt
- > Staging popt into destroot
- > Installing popt @1.15_0
- > Activating popt @1.15_0
- > Cleaning popt
- > Fetching rsync
- > Attempting to fetch rsync-3.0.6.tar.gz from http://distfiles.macports.org/rsync
- > Verifying checksum(s) for rsync
- > Extracting rsync
- > Applying patches to rsync
- > Configuring rsync
- > Building rsync
- > Staging rsync into destroot
- > Installing rsync @3.0.6_0
- > Activating rsync @3.0.6_0
- > Cleaning rsync
- > Fetching git-core
- > Attempting to fetch git-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
- > Attempting to fetch git-manpages-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
- > Attempting to fetch git-htmldocs-1.6.5.tar.bz2 from http://distfiles.macports.org/git-core
- > Verifying checksum(s) for git-core
- > Extracting git-core
- > Applying patches to git-core
- > Configuring git-core
- > Building git-core
- > Staging git-core into destroot
- > Installing git-core @1.6.5_0+bash_completion+doc+gitweb
- > Activating git-core @1.6.5_0+bash_completion+doc+gitweb
- > Cleaning git-core
-
bash-3.2$ sudo port install cgit Password:
-
-
- > Computing dependencies for cgit
- > Fetching cgit
- > Attempting to fetch cgit-0.8.2.1.tar.bz2 from http://distfiles.macports.org/git-core
- > Attempting to fetch git-1.6.3.tar.bz2 from http://distfiles.macports.org/git-core
- > Verifying checksum(s) for cgit
- > Extracting cgit
- > Configuring cgit
- > Building cgit
- > Staging cgit into destroot
- > Installing cgit @0.8.2.1_0
- > Activating cgit @0.8.2.1_0
- > Cleaning cgit
-
gitコマンドをたたいてみた
bash-3.2$ git usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory commit Record changes to the repository diff Show changes between commits, commit and working tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init Create an empty git repository or reinitialize an existing one log Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink pull Fetch from and merge with another repository or a local branch push Update remote refs along with associated objects rebase Forward-port local commits to the updated upstream head reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed with GPG See 'git help COMMAND' for more information on a specific command.
使い方覚えねば・・・
Snow LeopardにRedmineをインストール
Redmineのインストール
Redminのサイトから最新版(*.tar.gz)を取得
適当な場所にアーカイブを展開
bash-3.2$ tar zxvf redmine-0.8.5.tar.gz
展開されたディレクトリ"redmine-0.8.5"を$HOME/Library配下に"redmine"という名前にして移動
bash-3.2$ mv redmine-0.8.5 ~/Library/redmine
Ruby On Railsもアップデート
bash-3.2$ sudo gem update rails
RubyのMySQL用インターフェイスをインストール
bash-3.2$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config Building native extensions. This could take a while... Successfully installed mysql-2.8.1 1 gem installed Installing ri documentation for mysql-2.8.1... No definition for next_result 〜〜(省略)〜〜 bash-3.2$ bash-3.2$ echo $? 0 bash-3.2$
Redmine用データベースとユーザを作成
bash-3.2$ mysql -u root -p ... mysql> create database redmine default character set utf8; Query OK, 1 row affected (0.01 sec) mysql> show databases;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Database |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
information_schema | |
mysql | |
redmine | |
test |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
RedmineのDB接続設定
bash-3.2$ cd ~/Library/redmine/config bash-3.2$ cp database.yml.example database.yml bash-3.2$ vi database.yml .... Production節を以下のように設定*1 ... 9 production: 10 adapter: mysql 11 database: redmine 12 host: localhost 13 username: redmine 14 password: 15 encoding: utf8
redmine用のテーブル作成
bash-3.2$ sudo rake db:migrate RAILS_ENV=production Password: (in /Users/xxxxxx/Library/redmine) == 1 Setup: migrating ========================================================= -- create_table("attachments", {:force=>true}) -> 0.1432s 〜〜(省略)〜〜 bash-3.2$ bash-3.2$ echo $? 0
Redmineの初期データ設定
bash-3.2$ sudo rake redmine:load_default_data RAILS_ENV=production (in /Users/xxxxxx/Library/redmine) Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr, sv, th, tr, uk, vn, zh, zh-tw [en] ja ==================================== Default configuration data loaded.
Redmine起動
bash-3.2$ cd ~/Library/redmine bash-3.2$ ruby script/server -e production => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.2 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with production environment... Rails Error: Unable to access log file. Please ensure that /Users/xxxxxx/Library/redmine/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:3000 ** Use CTRL-C to stop.
ブラウザでhttp://localhost:3000/にアクセスするとTOP画面が表示された。
左上の"Sign in"を選択してログイン画面を表示し
Login: admin
Password: admin
でログインする。
デフォルトで英語表示になっているので左上の"My Account"から言語を日本語に変更する。
参考URL
MySQLの基本的な操作を覚える。
MySQLに接続する。
オプション指定なし
bash-3.2$ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 29 Server version: 5.0.86 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> quit; Bye bash-3.2$
オプションをまったく指定しないとOSのログインユーザ名を使用して接続する。*1
rootユーザで接続
bash-3.2$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 30 Server version: 5.0.86 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> quit; Bye bash-3.2$
rootユーザのパスワードは設定済みのため、-pオプションもつける。
MySQLサーバの状態を確認する。
データベースの一覧を表示する。
bash-3.2$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 34 Server version: 5.0.86 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Database |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
information_schema | |
mysql | |
test |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
現在のカレントDB(接続中のDB)はどれなのだろうか?
mysql> select database();
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
database() |
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
NULL |
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
接続先のDBを指定していないので"NULL"だそうです。
使用するDBを指定すると・・・
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> mysql> select database();
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
database() |
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
mysql |
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
カレントDBが変わったことが確認できました。
ユーザ一覧を表示する。
ユーザ一覧を表示するには、データベースmysqlのuserテーブルの内容を表示する。
bash-3.2$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39 Server version: 5.0.86 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select host, user, password from user;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ユーザは、host毎に定義するのか・・・
user名が空白で表示されているのが匿名ユーザだな。*2
データベース内のテーブル一覧を表示する。
mysql> show tables;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tables_in_mysql |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
columns_priv | |
db | |
func | |
help_category | |
help_keyword | |
help_relation | |
help_topic | |
host | |
proc | |
procs_priv | |
tables_priv | |
time_zone | |
time_zone_leap_second | |
time_zone_name | |
time_zone_transition | |
time_zone_transition_type | |
user |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
テーブルのカラムを表示する。
mysql> desc host;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Field | Type | Null | Key | Default | Extra |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Host | char(60) | NO | PRI | |||
Db | char(64) | NO | PRI | |||
Select_priv | enum('N','Y') | NO | N | |||
Insert_priv | enum('N','Y') | NO | N | |||
Update_priv | enum('N','Y') | NO | N | |||
Delete_priv | enum('N','Y') | NO | N | |||
Create_priv | enum('N','Y') | NO | N | |||
Drop_priv | enum('N','Y') | NO | N | |||
Grant_priv | enum('N','Y') | NO | N | |||
References_priv | enum('N','Y') | NO | N | |||
Index_priv | enum('N','Y') | NO | N | |||
Alter_priv | enum('N','Y') | NO | N | |||
Create_tmp_table_priv | enum('N','Y') | NO | N | |||
Lock_tables_priv | enum('N','Y') | NO | N | |||
Create_view_priv | enum('N','Y') | NO | N | |||
Show_view_priv | enum('N','Y') | NO | N | |||
Create_routine_priv | enum('N','Y') | NO | N | |||
Alter_routine_priv | enum('N','Y') | NO | N | |||
Execute_priv | enum('N','Y') | NO | N |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Snow LeopardにMySQLをインストール(まとめ)
インストール先
mac portsでインストールした場合は、/opt/local/bin, /opt/local/sbinにPATHを設定する。
尚、mysqladminは別の場所にあるのでそこにもPATHを通す。
(bashの場合)$HOME/.bashrcにPATHを設定しておく。*2
export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/opt/local/lib/mysql5/bin
mac portsでインストールする場合のオプション指定
昨日インストールした時に指定したオプション(variants)は間違っていたようだ。
bash-3.2$ sudo port install mysql5 +server
mysql5インストール時に指定できるvariantsは以下のコマンドで確認可能
bash-3.2$ port variants mysql5 mysql5 has the variants: server: Obsolete; install mysql5-server port instead universal: Build for multiple architectures
serverというvariantsはもうないようです。換わりに"mysql5-server"というパッケージ名を指定せよとのこと。
因にmysql4ではどうだったかというと
bash-3.2$ port variants mysql4 mysql4 has the variants: server universal: Build for multiple architectures
serverというvariantsはmysql4の時に指定できたものだったようです。
MySQLと一緒にインストールされたもの
パッケージの依存性は以下のコマンドで確認可能
bash-3.2$ port deps mysql5 Full Name: mysql5 @5.0.86 Library Dependencies: zlib, openssl, readline
MySQL5の場合は、zlib, openssl, readlineが同時にインストールされる模様。
但し、昨日のインストールログを見るとncurseswとncursesも同時にインストールされている。
これは、readlineがncursesに依存しており、さらにそのncursesがncurseswに依存しているため、芋づる式にこれらも適用されたためである。
bash-3.2$ port deps readline Full Name: readline @6.0.000+darwin Library Dependencies: ncurses bash-3.2$ bash-3.2$ port deps ncurses Full Name: ncurses @5.7+darwin_10 Runtime Dependencies: ncursesw
Snow LeopardにMySQLをインストール
MacPortsを使ってMacにMySQLをインストールを参考にしてインストールしてみた。
インストール開始
bash-3.2$ sudo port install mysql5 +server Password:
-
-
- > Computing dependencies for mysql5
- > Fetching zlib
- > Attempting to fetch zlib-1.2.3.tar.bz2 from http://distfiles.macports.org/zlib
- > Verifying checksum(s) for zlib
- > Extracting zlib
- > Applying patches to zlib
- > Configuring zlib
- > Building zlib
- > Staging zlib into destroot
- > Installing zlib @1.2.3_3
- > Activating zlib @1.2.3_3
- > Cleaning zlib
- > Fetching openssl
- > Attempting to fetch openssl-0.9.8k.tar.gz from http://distfiles.macports.org/openssl
- > Verifying checksum(s) for openssl
- > Extracting openssl
- > Applying patches to openssl
- > Configuring openssl
- > Building openssl
- > Staging openssl into destroot
- > Installing openssl @0.9.8k_0+darwin
- > Activating openssl @0.9.8k_0+darwin
- > Cleaning openssl
- > Fetching ncursesw
- > Attempting to fetch ncurses-5.7.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/ncurses
- > Verifying checksum(s) for ncursesw
- > Extracting ncursesw
- > Configuring ncursesw
- > Building ncursesw
- > Staging ncursesw into destroot
- > Installing ncursesw @5.7_0+darwin_10
- > Activating ncursesw @5.7_0+darwin_10
- > Cleaning ncursesw
- > Fetching ncurses
- > Verifying checksum(s) for ncurses
- > Extracting ncurses
- > Configuring ncurses
- > Building ncurses
- > Staging ncurses into destroot
- > Installing ncurses @5.7_0+darwin_10
- > Activating ncurses @5.7_0+darwin_10
- > Cleaning ncurses
- > Fetching readline
- > Attempting to fetch readline-6.0.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/readline
- > Verifying checksum(s) for readline
- > Extracting readline
- > Applying patches to readline
- > Configuring readline
- > Building readline
- > Staging readline into destroot
- > Installing readline @6.0.000_2+darwin
- > Activating readline @6.0.000_2+darwin
- > Cleaning readline
- > Fetching mysql5
- > Attempting to fetch mysql-5.0.86.tar.gz from http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/
- > Attempting to fetch mysql-5.0.86.tar.gz from http://mysql.he.net/Downloads/MySQL-5.0/
- > Verifying checksum(s) for mysql5
- > Extracting mysql5
- > Applying patches to mysql5
- > Configuring mysql5
-
-
-
- > Building mysql5
- > Staging mysql5 into destroot
- > Installing mysql5 @5.0.86_0+server
- > Activating mysql5 @5.0.86_0+server
- > Cleaning mysql5
-
すぐに終わるのかと思いきや20分くらいかかりました。
opensslやら何やら必要なものも一緒に入れてくれてるようです。
(mac portsのことよくわかってません。)
最後の方で何か出ました。
+serverというオプションはもう使えないそうです。
インストール自体をうまくいってるのかな?
一応、mysql5-serverでやり直す。
bash-3.2$ sudo port install mysql5-server Password:
-
-
- > Computing dependencies for mysql5-server
- > Fetching mysql5-server
- > Verifying checksum(s) for mysql5-server
- > Extracting mysql5-server
- > Configuring mysql5-server
- > Building mysql5-server
- > Staging mysql5-server into destroot
- > Creating launchd control script
-
-
-
- > Installing mysql5-server @5.0.86_0
-
-
-
- > Activating mysql5-server @5.0.86_0
- > Cleaning mysql5-server
-
既に入っているような感じ。
初期化を実施
bash-3.2$ sudo -u mysql mysql_install_db5 Password: Installing MySQL system tables... 091013 22:23:44 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive OK Filling help tables... 091013 22:23:45 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive OK To 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/mysql5/bin/mysqladmin -u root password 'new-password' /opt/local/lib/mysql5/bin/mysqladmin -u root -h hostname.local password 'new-password' Alternatively you can run: /opt/local/lib/mysql5/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/mysql5/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/mysql5/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 bash-3.2$ bash-3.2$ echo $? 0
それでMySQL起動
bash-3.2$ sudo /opt/local/share/mysql5/mysql/mysql.server start Password: Starting MySQL . SUCCESS!
めでたくサクセス!
が!こんなん出ました。
めんどいのでとりあえず「許可」
(だいじょうぶか?後でFirewallで制限かけられるのかな?)
接続確認
bash-3.2$ mysql5 -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.86 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> help For information about MySQL products and services, visit: http://www.mysql.com/ For developer information, including the MySQL Reference Manual, visit: http://dev.mysql.com/ To buy MySQL Network Support, training, or other products, visit: https://shop.mysql.com/ List of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear (\c) Clear the current input statement. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Don't show warnings after every statement. For server side help, type 'help contents' mysql> q -> quit -> / -> \q Bye bash-3.2$
繋がった!
\qで抜けるのね。
パスワード設定
/opt/local/lib/mysql5/bin/mysqladmin -u root password xxxxxxxx
外付けハードディスクのデータ消去
不要になったHDのデータを消去したのでその手順を残しておく。
使用したツール
参考URL
使用したツールのHP
ダウンロード先
実行方法用
-
- HDの中身を全部削除しておく。*1
- データ消去実行
C:\> cd C:\Tmp\fau-1.3.0.2390a\fau\FAU.x86 C:\Tmp\fau-1.3.0.2390a\fau\FAU.x86>wipe \\.\f Forensic Acquisition Tools, 1, 3, 0, 2390 wipe, 1, 3, 0, 2390 Copyright (C) 2002-2009 GMG Systems, Inc. Command Line: wipe \\.\f: Microsoft Windows XP 5.1.2600 Multiprocessor Free(xxxxxxxxx) 2009/10/10 4:40:21 (UTC) 2009/10/10 13:40:21 (local time) Current User: xxxxxxxxx Current Locale: Japanese_Japan.932 Default Local Language: 0x0411 Do you want to wipe \\.\f:? [Y]es or [No]?y WARNING!!! ALL DATA WILL BE DESTROYED. Are you sure that you want to wipe \\.\f:? [Y]es or [No]?y Writing FF bits to allocated range 0x0000000000000000:120056154624 of \\.\f:: 100 percent complete Completed in 7066265 milliseconds, 120056154624 bytes written. Writing random bits to allocated range 0x0000000000000000:120056154624 of \\.\f: : 100 percent complete Completed in 17987453 milliseconds, 120056154624 bytes written. Writing null bytes to allocated range 0x0000000000000000:120056154624 of \\.\f: : 100 percent complete Completed in 6053765 milliseconds, 120056154624 bytes written. 2009/10/10 13:19:00 (UTC) 2009/10/10 22:19:00 (local time) C:\Tmp\fau-1.3.0.2390a\fau\FAU.x86>
120GBのHDでデータの消去にトータルで9時間かかった。
*1:HDにファイルが残っていると1つずつ消去するか聞いてきてうざいので