热门标签 | HotTags
当前位置:  开发笔记 > 后端 > 正文

编译安装MariaDB5.5数据库

今天早上看到开源社区介绍MySQL手册已经悄悄移除GPL许可证,看来离收费不远了。公司的mysql要迁移到MariaDB上了。下载:wgethttp://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gzwgethttp://mirrors.ustc.edu.cn/mariadb/m
今天早上看到开源社区介绍MySQL 手册已经悄悄移除 GPL 许可证,看来离收费不远了。公司的mysql 要迁移到MariaDB上了。
下载:
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
wget http://mirrors.ustc.edu.cn/mariadb/mariadb-5.5.31/kvm-tarbake-jaunty-x86/mariadb-5.5.31.tar.gz
安装cmake,mysql-5.5后需要使用cmake配置
tar zxf cmake-2.8.5.tar.gz
cd cmake-2.8.5
./bootstrap
make
make install
cd ..
安装mariadb
CFLAGS="-O3"
CXX=gcc
CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
yum install ncurses-devel -y
yum install libaio-devel -y
useradd mysql
tar -zxvf mariadb-5.5.27.tar.gz
cd mariadb-5.5.27
cmake . -LH|more //CMake下查看MySQL的编译配置
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariamysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1  -DENABLED_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci   -DWITH_DEBUG=0 -DBUILD_COnFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF
make -j 8      //-j指定用于编译的CPU核数,可以加快编译速度
make install
cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
/usr/local/mariamysql/scripts/mysql_install_db --basedir=/usr/local/mariamysql/  --datadir=/usr/local/mariamysql/data/ --user=mysql
/usr/local/mariamysql/bin/mysqld_safe --user=mysql &
root@test:[/usr/local/mariamysql/bin]mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.31-MariaDB-log MariaDB Server
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

推荐阅读
author-avatar
手机用户2502922415_737
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有