$ sudo mysql_install_db5 Installing MySQL system tables... 090422 22:57:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 090422 22:57:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 090422 22:57:50 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive OK Filling help tables... 090422 22:57:51 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 090422 22:57:51 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295 090422 22:57:51 [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 ogagagaMacBook.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
■所有権変更
$ sudo chown -R mysql /opt/local/var/db/mysql5/ $ sudo chgrp -R mysql /opt/local/var/db/mysql5/
■my.cnfコピー&編集
$ vi my.cnf 開いたら以下を[mysqld]へ追記 default-character-set = utf8 default-storage-engine = innodb
■MySQLサーバー起動
$ sudo mysqld_safe5
■MySQL起動確認
$ mysql5 -u root -p Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
$ sudo port install mysql5 +server ---> Fetching zlib ---> Attempting to fetch zlib-1.2.3.tar.bz2 from http://easynews.dl.sourceforge.net/libpng ---> Verifying checksum(s) for zlib ---> Extracting zlib ---> Applying patches to zlib ---> Configuring zlib ---> Building zlib Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/work/zlib-1.2.3" && make all " returned error 127 Command output: sh: make: command not found
Error: The following dependencies failed to build: openssl zlib readline ncurses ncursesw Error: Status 1 encountered during processing.
$ vi .bashrc export PATH=/opt/local/bin:/opt/local/sbin/:$PATH export MANPATH=/opt/local/man:$MANPATH
4.インストール確認
$ port MacPorts 1.710 Entering interactive mode... ("help" for help, "quit" to quit) [Users/ogagaga] >
ということなので、インストールはできたみたい。
5.MacPortsをアップデート
$ sudo port -d selfupdate DEBUG: Synchronizing ports tree(s) Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/ DEBUG: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/ports/ /opt/local/var/macports/sources/rsync.macports.org/release/ports receiving file list ... done
sent 36 bytes received 379168 bytes 84267.56 bytes/sec total size is 23112896 speedup is 60.95 DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/base DEBUG: Updating MacPorts sources using rsync receiving file list ... done
sent 36 bytes received 6921 bytes 2782.80 bytes/sec total size is 4061730 speedup is 583.83
MacPorts base version 1.710 installed DEBUG: Rebuilding and reinstalling MacPorts if needed Downloaded MacPorts base version 1.710
The MacPorts installation is not outdated so it was not updated DEBUG: Setting MacPorts sources ownership to root
$ sudo port -d sync DEBUG: Synchronizing ports tree(s) Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/ DEBUG: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/ports/ /opt/local/var/macports/sources/rsync.macports.org/release/ports receiving file list ... done
sent 36 bytes received 379168 bytes 108344.00 bytes/sec total size is 23112896 speedup is 60.95
$ gem install rails Bulk updating Gem source index for: http://gems.rubyforge.org ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /usr/bin directory.
いきなり怒られた(笑)。
権限がないということなので、
$ sudo gem install rails WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password: Bulk updating Gem source index for: http://gems.rubyforge.org
ここで3分くらい待ったあとインストールが始まった。
Successfully installed rake-0.8.4 Successfully installed activesupport-2.3.2 Successfully installed activerecord-2.3.2 Successfully installed actionpack-2.3.2 Successfully installed actionmailer-2.3.2 Successfully installed activeresource-2.3.2 Successfully installed rails-2.3.2 7 gems installed Installing ri documentation for rake-0.8.4... Installing ri documentation for activesupport-2.3.2... Installing ri documentation for activerecord-2.3.2... Installing ri documentation for actionpack-2.3.2... Installing ri documentation for actionmailer-2.3.2... Installing ri documentation for activeresource-2.3.2... Installing RDoc documentation for rake-0.8.4... Installing RDoc documentation for activesupport-2.3.2... Installing RDoc documentation for activerecord-2.3.2... Installing RDoc documentation for actionpack-2.3.2... Installing RDoc documentation for actionmailer-2.3.2... Installing RDoc documentation for activeresource-2.3.2...