在solrais下编译安装MySQL

  • 来源: 互联网 作者: rocket   2008-03-17/10:40
  • 很多朋友在sun下编译mysql都会有些问题,现在我把编译过程整理如下,希望对大家有所帮助。
    环境:
    sun250+solaris8
    过程:
    首先要安装solaris8的编译环境,去http://www.sunfreeware.com/下载一下软件:
    1.autoconf-2.13-sol8-sparc-local.gz
    2.automake-1.4-sol8-sparc-local.gz
    3.bison-1.28-sol8-sparc-local.gz
    4.gcc-2.95.3-sol8-sparc-local.gz
    5.gzip-1.3-sol8-sparc-local
    6.make-3.79.1-sol8-sparc-local.gz
    去www.gnu.org下载gnu_tar,最新的版本是tar-1.13.tar.gz
    设置环境变量,编译过程需要用到sun的一些命令,但是这些命令默认是不在你的PATH里的所以需要我们手工添加,我用的是bash所以修改root用户的.bash_profile中的PATH为
    PATH=/usr/local/sbin:/usr/local/bin:/usr/ccs/bin:/usr/sbin:/sbin:$PATH:$HOME/bin:/usr/local/mysql/bin:
    退出重新登录使变量生效,按照下列步骤安装软件:
    1.pkgadd -d gzip-1.3-sol8-sparc-local
    2.gunzip autoconf-2.13-sol8-sparc-local.gz
    3.gunzip automake-1.4-sol8-sparc-local.gz
    4.gunzip gcc-2.95.3-sol8-sparc-local.gz
    5 gunzip bison-1.28-sol8-sparc-local.gz
    6.pkgadd -d autoconf-2.13-sol8-sparc-local
    7.pkgadd -d automake-1.4-sol8-sparc-local
    8.pkgadd -d gcc-2.95.3-sol8-sparc-local
    9.pkgadd -d make-3.79.1-sol8-sparc-local
    10.gunzip tar-1.13.tar.gz
    11.tar xvf tar-1.13.tar
    12.cd tar-1.13
    13../configure --prefix=/usr/local/gnu_tar
    14. make
    15. make install
    16. vi ~/.bashrc添加
    alias tar='/usr/local/gnu_tar/bin/tar'
    17.alias tar='/usr/local/gnu_tar/bin/tar'
    18.tar zxvf mysql-3.23.44.tar.gz
    19.cd mysql-3.23.44
    20.which perl(检查你系统的perl的位置,sun是在/bin下)
    21.cd tests把这个目录中所有以pl结尾的文件的perl解释器的位置改为#!/bin/perl
    22.cd ..(返回上一级目录)
    23. CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --with-extra-charsets=all
    24.make
    25.make install
    26.cd support-files
    27.chmod 700 mysql.server
    28.cp mysql.server /etc/rc2.d/S90MySQL(以上三部是为了在系统引导时自动启动MySQL服务)
    29.修改.bash_profile把mysql的路径添进去,上面我加过了,所以这部就免了。
    30.useradd -d /usr/local/mysql/var -s /bin/false mysql(创建MySQL运行用户)
    31.mysql_install_db(初始话数据库)
    32.chown -R mysql /usr/local/mysql/var
    33./etc/rc2.d/S90MySQL start(启动数据库)
    34.mysql(连接测试)
    [root@mailtest support-files]# mysql
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1 to server version: 3.23.44

    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

    mysql>
    35.安装完毕


    评论 {{userinfo.comments}}

    {{money}}

    {{question.question}}

    A {{question.A}}
    B {{question.B}}
    C {{question.C}}
    D {{question.D}}
    提交

    驱动号 更多