CentOS 6.4 x64 源码安装 mariadb 5.5.33a

mariadb 其实就是 mysql


/usr/sbin/groupadd mysql

/usr/sbin/useradd -g mysql mysql


mkdir -p /opt/local/mariadb/data

mkdir -p /opt/local/mariadb/binlog

mkdir -p /opt/local/mariadb/log

mkdir -p /opt/local/mariadb/relaylog


tar zxvf mariadb-5.5.33a.tar.gz

cd mariadb-5.5.33a

/usr/local/bin/cmake -DCMAKE_INSTALL_PREFIX="/opt/local/mariadb" -DDEFAULT_CHARSET=utf8 -DMYSQL_DATADIR="/opt/local/mariadb/data/" -DCMAKE_INSTALL_PREFIX="/opt/local/mariadb" -DINSTALL_PLUGINDIR=plugin -DSYSCONFDIR="/opt/local/mariadb" -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_COLLATION=utf8_general_ci  -DENABLE_DEBUG_SYNC=0 -DENABLED_LOCAL_INFILE=1 -DENABLED_PROFILING=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_ZLIB=system -DWITH_EXTRA_CHARSETS=none -DMYSQL_MAINTAINER_MODE=OFF -DWITH_DEBUG=OFF -DEXTRA_CHARSETS=all -DWITH_FAST_MUTEXES=ON

chmod +w /opt/local/mariadb

chown -R mysql:mysql /opt/local/mariadb

ln -s /opt/local/mariadb/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18

ln -s /opt/local/mariadb/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18

/sbin/ldconfig


./scripts/mysql_install_db --defaults-file=/opt/local/mariadb/my.cnf --basedir=/opt/local/mariadb --datadir=/opt/local/mariadb/data --user=mysql


cp ./support-files/mysql.server /etc/init.d/mariadb


chmod 755 /etc/init.d/mariadb


chkconfig mariadb on


echo 'basedir=/opt/local/mariadb/' >> /etc/init.d/mariadb

echo 'datadir=/opt/local/mariadb/data' >>/etc/init.d/mariadb


service mariadb start


ln -s /var/lib/mariadb/mysql.sock /tmp/mysql.sock


/opt/local/mariadb/bin/mysqladmin -u root password 'rldb123'


你可能感兴趣的