时间:2021-07-01 10:21:17 帮助过:25人阅读
1、mariadb的编译过程 编译前准备 # yum install cmake ncurses-devel gcc gcc-c++ # groupadd -r mysql # useradd -r -g mysql -s /sbin/nologin -M mysql # mkdir /opt/data # chown mysql.mysql /opt/data -R # tar xf mariadb-10.0.13.tar.gz # cd /mariadb-10.0.13 2、配置文件 cmake . -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_DATADIR=/opt/data -DSYSCONFDIR=/opt/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0 -DMYSQL_UNIX_ADDR=/opt/data/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci | tee /tmp/mariadb.bak 提示:如果在编译过程中出现错误,把欠缺的库打完之后,需要rm -rf CMakeCache.txt后在进行cmake..... # make && make install # cd /opt/mysql # cp support-files/my-large.cnf ./my.cnf 添加配置文件 # scripts/mysql_install_db --datadir=/opt/data --user=mysql 初始化数据库 # cp support-files/mysql.server /etc/rc.d/init.d/mysqld 复制启动脚本 # chmod +x /etc/rc.d/init.d/mysqld # chkconfig --add mysqld # chkconfig mysqld on # chown mysql.mysql /opt/mysql -R 由于mysql的/opt/mysql/mysql.sock在mysql目录下,所以这里必须的给属主组为mysql权限。否则无法启动。 # service mysqld start 添加PATH路径: # vim /etc/profile.d/mysql.sh export PATH=/opt/mysql/bin:$PATH # source /etc/profile.d/mysql.sh # mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.0.13-MariaDB-log Source distribution Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. MariaDB [(none)]> 授权用户: grant all on *.* to root @‘%‘ identified by ‘ning‘; flush privileges;
本文出自 “奋斗的人” 博客,请务必保留此出处http://wodemeng.blog.51cto.com/1384120/1690806
mariadb源码编译
标签:mariadb编译安装