MYSQL一键安装

#!/bin/bash
#baishuchao qq:995345781
##################################################################
MAKE_RUN=$(($(more /proc/cpuinfo | grep processor | wc -l) + 1))
groupadd mysql
useradd -g mysql -s /sbin/nologin mysql
tar zxvf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure \
    --prefix=/usr/local/mysql \
    --enable-assembler \
    --without-debug \
    --with-mysqld-ldflags=-all-static \
    --with-charset=utf8 \
    --with-extra-charsets=all \
    --with-innodb \
    --with-unix-socket-path=/usr/local/mysql/mysql.sock \
    --enable-thread-safe-client \
    --with-mysqld-user=mysql
make -j ${MAKE_RUN}
make install
/usr/local/mysql/bin/mysql_install_db --user=mysql
cd ..

  

 

posted @ 2018-02-02 17:00  云原生运维社区  阅读(168)  评论(0编辑  收藏  举报