CentOS系统编译安装mariadb数据库过程
时间:2014-12-18 21:13 来源:linux.it.net.cn 作者:IT
MariaDB 是一个采用 Maria 存储引擎的 MySQL 分支版本,是由原来 MySQL 的作者 Michael Widenius 创办的公司所开发的免费开源的数据库服务器。
本人安装的是 MariaDB 5.2.10版本,其他版本基本雷同
2.解压源码包
tar -zxf mariadb-5.1.2.10.tar.gz
3.进入 mariadb-5.2.10(cd mariadb-5.2.10)
编译过程中需要用到一些支持类库只需要yum安装即可
yum install gcc gcc-c++ make #(或者还有其他自己百度搞定,我在编译的过程中只遇到需要这些);
4.配置 ./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all
5. make & make install
6.groupadd mysql
useradd -g mysql mysql
cp support-files/my-medium.cnf /etc/my.cnf
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chown root.root /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig --list mysqld
chkconfig --levels 245 mysqld off
ln /usr/local/mysql/bin/mysql /usr/bin/mysql
7.修改/sbin/service文件
#!/bin/sh
. /etc/init.d/functions
VERSION="$(basename $0) ver. 0.91"
USAGE="Usage: $(basename $0) < option > | --status-all | \
[ service_name [ command | --full-restart ] ]"
SERVICE=
SERVICEDIR="/etc/init.d"
OPTIONS=
if [ $# -eq 0 ]; then
echo "${USAGE}" >&2
exit 1
fi
cd /
while [ $# -gt 0 ]; do
case "${1}" in
--help | -h | --h* )
echo "${USAGE}" >&2
exit 0
;;
--version | -V )
echo "${VERSION}" >&2
exit 0
;;
*)
if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
cd ${SERVICEDIR}
for SERVICE in * ; do
case "${SERVICE}" in
functions | halt | killall | single| linuxconf| kudzu)
;;
*)
if ! is_ignored_file "${SERVICE}" \
&& [ -x "${SERVICEDIR}/${SERVICE}" ]; then
env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" status
fi
;;
esac
done
exit 0
elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
SERVICE="${1}"
if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" stop
env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" start
exit $?
fi
elif [ -z "${SERVICE}" ]; then
SERVICE="${1}"
else
OPTIONS="${OPTIONS} ${1}"
fi
shift
;;
esac
done
if [ -f "${SERVICEDIR}/${SERVICE}" ]; then
env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
else
echo $"${SERVICE}: unrecognized service" >&2
exit 1
fi
编译过程中可能会发生错误,需要安装 gcc gcc-c++ make ,希望对亲们有所帮助 ^_^ 。 (责任编辑:IT)
MariaDB 是一个采用 Maria 存储引擎的 MySQL 分支版本,是由原来 MySQL 的作者 Michael Widenius 创办的公司所开发的免费开源的数据库服务器。 本人安装的是 MariaDB 5.2.10版本,其他版本基本雷同 2.解压源码包 tar -zxf mariadb-5.1.2.10.tar.gz 3.进入 mariadb-5.2.10(cd mariadb-5.2.10) 编译过程中需要用到一些支持类库只需要yum安装即可 yum install gcc gcc-c++ make #(或者还有其他自己百度搞定,我在编译的过程中只遇到需要这些); 4.配置 ./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all 5. make & make install 6.groupadd mysql useradd -g mysql mysql cp support-files/my-medium.cnf /etc/my.cnf chown -R root /usr/local/mysql chown -R mysql /usr/local/mysql/var chgrp -R mysql /usr/local/mysql /usr/local/mysql/bin/mysqld_safe --user=mysql & cp support-files/mysql.server /etc/rc.d/init.d/mysqld chown root.root /etc/rc.d/init.d/mysqld chmod 755 /etc/rc.d/init.d/mysqld chkconfig --add mysqld chkconfig --list mysqld chkconfig --levels 245 mysqld off ln /usr/local/mysql/bin/mysql /usr/bin/mysql 7.修改/sbin/service文件 #!/bin/sh . /etc/init.d/functions VERSION="$(basename $0) ver. 0.91" USAGE="Usage: $(basename $0) < option > | --status-all | \ [ service_name [ command | --full-restart ] ]" SERVICE= SERVICEDIR="/etc/init.d" OPTIONS= if [ $# -eq 0 ]; then echo "${USAGE}" >&2 exit 1 fi cd / while [ $# -gt 0 ]; do case "${1}" in --help | -h | --h* ) echo "${USAGE}" >&2 exit 0 ;; --version | -V ) echo "${VERSION}" >&2 exit 0 ;; *) if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then cd ${SERVICEDIR} for SERVICE in * ; do case "${SERVICE}" in functions | halt | killall | single| linuxconf| kudzu) ;; *) if ! is_ignored_file "${SERVICE}" \ && [ -x "${SERVICEDIR}/${SERVICE}" ]; then env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" status fi ;; esac done exit 0 elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then SERVICE="${1}" if [ -x "${SERVICEDIR}/${SERVICE}" ]; then env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" stop env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" start exit $? fi elif [ -z "${SERVICE}" ]; then SERVICE="${1}" else OPTIONS="${OPTIONS} ${1}" fi shift ;; esac done if [ -f "${SERVICEDIR}/${SERVICE}" ]; then env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} else echo $"${SERVICE}: unrecognized service" >&2 exit 1 fi 编译过程中可能会发生错误,需要安装 gcc gcc-c++ make ,希望对亲们有所帮助 ^_^ 。 (责任编辑:IT) |