代码很乱!下一步研究一下代码片 准备环境: 最小化安装CentOS7、gcc、gcc-c++、bison、ncurses、ncurses-devel、zlib-devel 下载MariaDB10.0.12源码包: cd /usr/local/src wget http://ftp.kaist.ac.kr/mariadb/mariadb-10.0.12/source/mariadb-10.0.12.tar.gz useradd -M -s /sbin/nologin mysql mkdir -p /data/mariadb chown -R mysql.mysql /data/mariadb tar zxvf mariadb-10.0.12.tar.gz cd mariadb-10.0.12
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb \ make && make install cd /usr/local/mariadb/support-files cp my-small.cnf /etc/my.cnf 修改my.cnf配置,增加以下几行: basedir=/usr/local/mariadb datadir=/data/mariadb pid-file=/data/mariadb/mariadb.pid log-error=/data/mariadb/mariadb.err 将服务器启动文件加入到系统启动中: cp mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld chkconfig --add mysqld chkconfig mysqld on bin目录加入path echo 'export PATH=$PATH:/usr/local/mariadb/bin' >>/etc/profile 创建数据库: cd /usr/local/mariadb/scripts ./mysql_install_db --user=mysql --basedir=/usr/local/mariadb datadir=/data/mariadb chown -R mysql:mysql /data/mariadb |