经历了不下十次以上的 configure make和make install,

终于搞定了。 归咎起来还是Opensolaris上软件的缺乏和不完整性。

之前一直用gcc编译,但一直会出现ld连接错误。

安装步骤:


  1. Install Sun compilers by issuing the following command: pfexec pkg install ss-dev.  The tools are installed in /opt/SunStudioExpress.
  2. Prepare the user environment for MySQL by issuing the following commands:
    • groupadd mysql
    • useradd -g mysql mysql
  3. Become the mysql user with su mysql.
  4. Download the latest MySQL source from dev.mysql.com. I downloaded the compressed GNU TAR archive (tar.gz) version 5.1.29-rc from here.
  5. Extract the MySQL source code from the archive with the commands below.  The source code will be extracted to mysql-5.1.29-rc.
    • gunzip mysql-5.1.29-rc.tar.gz
    • tar xvf mysql-5.1.29-rc.tar
  6. Set the following environment variables:
    • export CC=/opt/SunStudioExpress/bin/cc
    • export CXX=/opt/SunStudioExpress/bin/CC
    • export CFLAGS="-xO3" #Change this to have your compiler variables
    • export CXXFLAGS="-xO3"
    • export PATH=$CC:$CXX:/usr/sfw/bin:/usr/ccs/bin:$PATH
  7. Create a sym link from gmake to make with cd /usr/sfw/bin ; ln -s gmake make
  8. cd to the source code directiory. In my case mysql-5.1.29-rc.
  9. Execute the following command at the prompt: ./configure --prefix=/usr/local/mysql
    • The configure command allows you to control the configuration of the MySQL source distribution.  A full listing of the options to configure can be found here.  Prefix simply installs architecture-independent files in the location specified by prefix (everything is installed under /usr/local/mysql rather than the default of /usr/local).
  10. Execute the following command at the prompt: make
  11. Execute the following command at the prompt: make install
 At this point, under /usr/local/mysql/bin, you will see the mysql_install_db script, which will allow you to install MySQL.  After that, you can run mysqld_safe to start mysql.
Comments:

Very cool! Congrats on the pairing.

Posted by tiffany & co Bangle on November 13, 2009 at 03:00 PM CST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Ding-Ze Hironics Zhu