macportsでmysqlのインストール
macportsを使ってmysqlのインストール
まずportsのアップデートとソフトウェア一覧更新
sudo port -d selfupdate
sudo port -d sync
sudo port instal mysql5-serverもうインストール済みということで、初期化を実行
ちなみにmysql +serverはもう使えないので-serverになるので注意
起動しないので、忘れていたmy.cnfを作成
sudo -u mysql mysql_install_db5
sudo cp /opt/local/share/mysql5/mysql/my-small.cnf /opt/local/etc/mysql5/my.cnf
ここでエラー
/opt/local/share/mysql5/mysql/mysql.server start
Starting MySQL
. ERROR! Manager of pid-file quit without updating file.
このエラーは症状が様々で、解決が難しいらしい。
その中でもエラーログの保存場所が問題という記事があったので、以下をmy.cnfに追加
[mysqld]
log-error=/var/log/mysql/error.log
log=/var/log/mysql/detail.log
更に初期化すると良いらしいので、dbを初期化、そしてエラー
sudo -u mysql mysql_install_db5
Installing MySQL system tables...
091102 23:43:38 [Warning] The syntax '--log' is deprecated and will be removed in MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
OK
Filling help tables...
091102 23:43:41 [Warning] The syntax '--log' is deprecated and will be removed in MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.
OKTo start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your systemPLEASE 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 ntibrk101104.ibrk.nt.ftth.ppp.infoweb.ne.jp password 'new-password'Alternatively you can run:
/opt/local/lib/mysql5/bin/mysql_secure_installationwhich 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 /opt/local/mysql-test ; perl mysql-test-run.plPlease report any problems with the /opt/local/lib/mysql5/bin/mysqlbug script!
The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/
デーモンで起動して下さいということだったので、以下で実行
sudo /opt/local/lib/mysql5/bin/mysqld_safe
その後無事起動に成功
パスワードを設定してくださいということだったので
で設定
/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
mysql5 -u root -p
で無事起動
最後に自動起動するように設定
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
MacportsでMySQLをインストールしたまとめ - hellkite 日記と雑記とメモ。
MacPortsを使ってMySQL 5をインストールする - めも帖