linux wordpress 开源 nginx mysql shell 云计算 Ubuntu 微软 php centos apache Python 编程 java Android google 程序员 Firefox Windows

数据库 mariadb 5.5安装

今天早上看到开源社区介绍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>

延伸阅读

评论