逝者已逝,众恶徒已正法,然天下居庙堂者与处江湖者,当以此为鉴,牢记生命之重,人权之重,民主之重,法治之重,无使天下善良百姓,徒为鱼肉。 ——孙志刚墓志铭
  • macports,mysql,ruby - [朝花夕拾]

    2009-06-04

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://www.blogbus.com/dear-logs/40486043.html

    首先是装mysql,参见http://2tbsp.com/content/install_and_configure_mysql_5_macports

    1. installation

    sudo port install mysql5 +server

    2. create databases

    sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql

    3. start mysql

    sudo /opt/local/share/mysql5/mysql/mysql.server start

    or

    alias mysqlstart='sudo /opt/local/bin/mysqld_safe5

    4. stop mysql

    /opt/local/bin/mysqladmin5 -u root -p shutdown

    然后就是装mysql的adapter,这里因为是用macports装的mysql,所以会装到/opt/local下面去,跟默认的/usr/local/mysql不同,用gem装就行不通了,参考官网说明:http://www.tmtm.org/en/mysql/ruby/,这里只需要把第一步的参数修改一下:

    ruby extconf.rb --with-mysql-lib=/opt/local/lib/mysql5/mysql/ --with-mysql-include=/opt/local/include/mysql5/mysql/

    然后再一步步走下去就好了。

    分享到: