WDlinux官方论坛's Archiver

redmaozi 发表于 2013-8-31 23:37

求教管理员,重新编译MySQL要注意什么?

[i=s] 本帖最后由 redmaozi 于 2013-8-31 23:41 编辑 [/i]

[size=4]RT,需要给MySQL加入 分区特性,需要编译的时候加入partition参数,

求教管理员内置的数据库重新编译的时候需要注意什么???

求管理员把configure参数给出,让兄弟们少绕弯路啊!
[/size]

admin 发表于 2013-9-1 11:24

一键包里不就有吗

redmaozi 发表于 2013-9-1 11:24

找到一段源码:[code]# mysql install function
function mysql_ins {
    local IN_LOG=$LOGPATH/${logpre}_mysql_install.log
    echo
    [ -f $mysql_inf ] && return
    echo "installing mysql,this may take a few minutes,hold on plz..."
    cd $IN_SRC
    rm -fr mysql-$MYS_VER/
    tar xf mysql-$MYS_VER.tar.gz >$IN_LOG 2>&1
    if [ $OS_RL == 2 ]; then
        if [ -f /usr/lib/x86_64-linux-gnu/libncurses.so ]; then
            #LIBNCU="/usr/lib/x86_64-linux-gnu/libncurses.so"
            LIBNCU=""
        elif [ -f /usr/lib/i386-linux-gnu/libncurses.so ]; then
            #LIBNCU="/usr/lib/i386-linux-gnu/libncurses.so"
            LIBNCU=""
        else
            LIBNCU=""
        fi
    else
        if [ -f /usr/lib64/libncursesw.so ]; then
            LIBNCU="--with-named-curses-libs=/usr/lib64/libncursesw.so"
        elif [ -f /usr/lib/libncursesw.so ]; then
            LIBNCU="--with-named-curses-libs=/usr/lib/libncursesw.so"
        else
            LIBNCU=""
        fi
    fi      
    cd mysql-$MYS_VER/
    make_clean
    echo "configure in progress ..."
    ./configure --prefix=$IN_DIR/mysql-$MYS_VER \
        --sysconfdir=$IN_DIR/etc \
        --enable-assembler \
        --enable-thread-safe-client \
        --with-extra-charsets=complex \
        --with-plugins=partition \
        --with-ssl \
        --with-embedded-server $LIBNCU >>$IN_LOG 2>&1
    [ $? != 0 ] && err_exit "mysql configure err"
    echo "make in progress ..."
    make >>$IN_LOG 2>&1
    [ $? != 0 ] && err_exit "mysql make err"
    echo "make install in progress ..."
    make install >>$IN_LOG 2>&1
    [ $? != 0 ] && err_exit "mysql make install err"
    ln -sf $IN_DIR/mysql-$MYS_VER $IN_DIR/mysql
    [ -f /etc/my.cnf ] && mv /etc/my.cnf /etc/my.cnf.old
    cp support-files/mysql.server $IN_DIR/init.d/mysqld
    file_cp my.cnf $IN_DIR/etc/my.cnf
    ln -sf $IN_DIR/etc/my.cnf /etc/my.cnf
    $IN_DIR/mysql/bin/mysql_install_db >>$IN_LOG 2>&1
    chown -R mysql.mysql $IN_DIR/mysql/var
    chmod 755 $IN_DIR/init.d/mysqld
    ln -sf $IN_DIR/init.d/mysqld /etc/init.d/mysqld
    if [ $OS_RL == 2 ]; then
        update-rc.d -f mysqld defaults >>$IN_LOG 2>&1
    else
        chkconfig --add mysqld >>$IN_LOG 2>&1
        chkconfig --level 35 mysqld on >>$IN_LOG 2>&1
    fi
    ln -sf $IN_DIR/mysql/bin/mysql /bin/mysql
    mkdir -p /var/lib/mysql
    service mysqld start
    echo "PATH=\$PATH:$IN_DIR/mysql/bin" > /etc/profile.d/mysql.sh
    echo "$IN_DIR/mysql" > /etc/ld.so.conf.d/mysql-wdl.conf
    ldconfig >>$IN_LOG 2>&1
    $IN_DIR/mysql/bin/mysqladmin -u root password "wdlinux.cn"
    /www/wdlinux/mysql/bin/mysql -uroot -p"wdlinux.cn" -e \
        "use mysql;update user set password=password('wdlinux.cn') where user='root';
        delete from user where user='';
        DROP DATABASE test;
        drop user ''@'%';flush privileges;"
    ln -sf /tmp/mysql.sock /var/lib/mysql/
    touch $mysql_inf
}

[/code]其中在编译的时候添加如下参数就可以了!
[size=5][color=Red]--with-plugins=partition \[/color][/size]

jsrgsww 发表于 2016-7-8 13:40

在lib/mysql.sh中添加这句话--with-plugins=partition \但是要重新安装,怎么才能不重新安装WDCP

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.