Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7170198
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类: LINUX

2013-06-20 14:52:14


RHEL 7 中将不再包含 MySQL 数据库,而是用 MariaDB 替代之。而我们对MariaDB 不了解,今天就先学安装吧。



一,下载MariaDB
最新版本
mariadb-5.5.31.tar.gz


下载cmake

点击(此处)折叠或打开

  1. wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

二,安装
1) 安装cmake

点击(此处)折叠或打开

  1. [root@zabbix_server opt]# tar xzvf mariadb-5.5.31.tar.gz
  2. [root@zabbix_server cmake-2.8.5]# cd cmake-2.8.5
  3. [root@zabbix_server cmake-2.8.5]# ./bootstrap
  4. [root@zabbix_server cmake-2.8.5]# make
  5. [root@zabbix_server cmake-2.8.5]# make install

2) 安装MariaDB

点击(此处)折叠或打开

  1. yum install libaio-devel -y
  2. 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
  3. cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
  4. /usr/local/mariamysql/scripts/mysql_install_db --basedir=/usr/local/mariamysql/ --datadir=/usr/local/mariamysql/data/ --user=mysql
  5. /usr/local/mariamysql/bin/mysqld_safe --user=mysql &


点击(此处)折叠或打开

  1. yum install libaio-devel -y
  2. 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
  3. cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
  4. /usr/local/mariamysql/scripts/mysql_install_db --basedir=/usr/local/mariamysql/ --datadir=/usr/local/mariamysql/data/ --user=mysql
  5. /usr/local/mariamysql/bin/mysqld_safe --user=mysql &

三,查看

点击(此处)折叠或打开

  1. [root@zabbix_server mariadb-5.5.31]# ps -ef | grep mysql
  2. root 9010 17846 0 16:08 pts/0 00:00:00 /bin/sh /usr/local/mariamysql/bin/mysqld_safe --user=mysql
  3. mysql 9459 9010 0 16:08 pts/0 00:00:01 /usr/local/mariamysql/bin/mysqld --basedir=/usr/local/mariamysql --datadir=/data/database --plugin-dir=/usr/local/mariamysql/lib/plugin --user=mysql --log-error=/data/database/zabbix_server.err --open-files-limit=40960 --pid-file=zabbix_server.pid --socket=/data/database/mysql.sock --port=3306
  4. root 10391 17846 0 16:16 pts/0 00:00:00 grep mysql

  5. [root@zabbix_server mariadb-5.5.31]# mysql
  6. Welcome to the MySQL monitor. Commands end with ; or \g.
  7. Your MySQL connection id is 41
  8. Server version: 5.5.31-MariaDB-log MariaDB Server

  9. Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  10. This software comes with ABSOLUTELY NO WARRANTY. This is free software,
  11. and you are welcome to modify and redistribute it under the GPL v2 license

  12. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  13. root@zabbix ((none)) > show databases;
  14. +--------------------+
  15. | Database |
  16. +--------------------+
  17. | information_schema |
  18. | mysql |
  19. | zabbix |
  20. +--------------------+
  21. 3 rows in set (0.00 sec)

  22. root@zabbix ((none)) >

感觉和mysql一样
阅读(1394) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~