下载地址:

http://mirrors.ustc.edu.cn/mariadb/mariadb-10.0.19/source/mariadb-10.0.19.tar.gz

由于用cmake所以线安装下这个
能够

yum install cmake

下载了tar.gz文件解压到指定的文件夹tar
-zxvf XXX.tar.gz

进入到安装文件夹

[hcr@localhostmariadb-10.0.19]$ pwd

/app/mysql/mariadb-10.0.19

//创建下用户 分组,须要安装的文件夹,和数据库文件夹

[hcr@localhostmariadb-10.0.19]$ sudo groupadd mysql

[sudo] password forhcr:

[hcr@localhostmariadb-10.0.19]$ sudo useradd -g mysql mysql -s /bin/false

[hcr@localhostmariadb-10.0.19]$ mkdir -p /app/data/mysql

[hcr@localhostmariadb-10.0.19]$ sudo chown -R mysql:mysql /app/data/mysql/

[hcr@localhostmariadb-10.0.19]$ mkdir /app/local/mysql

cmake. -DCMAKE_INSTALL_PREFIX=/app/local/mysql-DMYSQL_DATADIR=/app/data/mysql/ -DSYSCONFDIR=/etc

这儿可能会碰到 缺少ncurses(报Curseslibrary
not found异常)的问题,能够安装下,

yum installncurses-devel
或者如今rpm
指定安装

[hcr@localhostmariadb-10.0.19]$ make

//此处有点慢,我去坑爹阿,太长时间了等把。早知道应该选择

[hcr@localhostmariadb-10.0.19]$ make install

//一堆的installing

[hcr@localhostmariadb-10.0.19]$ cd /app/local/mysql/

[hcr@localhostmysql]$ sudo cp support-files/my-huge.cnf /etc/my.cnf

[hcr@localhostmysql]$ sudo vi /etc/my.cnf //编辑配置文件,在[mysqld]部分添加
datadir= /app/data/mysql  //加入MariaDB数据库路径

datadir =/app/data/mysql

[hcr@localhostmysql]$ sudo cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

[hcr@localhostmysql]$ sudo chmod 755 /etc/init.d/mysqld

[hcr@localhostmysql]$ sudo chkconfig mysqld on

[hcr@localhostmysql]$ sudo vi /etc/rc.d/init.d/mysqld

这个地方默认是

basedir=

datadir=

改成

basedir =/app/local/mysql  #MariaDB程序安装路径

datadir= /app/data/mysql  #MariaDB数据库存放文件夹

//服务启动

[hcr@localhostmysql]$ sudo service mysqld start

Starting MySQL.SUCCESS!

//配置到环境中

[hcr@localhostmysql]$ sudo vi /etc/profile //添加了一个环境变量

exportPATH=$PATH:/app/local/mysql/bin

到这儿重起下机器

[hcr@localhostmysql]$ sudo shutdown -r now

初始化mysqlrootpassword

[root@localhost ~]#mysql_secure_installation

NOTE: RUNNING ALLPARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

SERVERS INPRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log intoMariaDB to secure it, we'll need the current

password for theroot user. If you've just installed MariaDB, and

you haven't set theroot password yet, the password will be blank,

so you should justpress enter here.

Enter currentpassword for root (enter for none):

ERROR 1045 (28000):Access denied for user 'root'@'localhost' (using password: YES)

Enter currentpassword for root (enter for none):

ERROR 1045 (28000):Access denied for user 'root'@'localhost' (using password: YES)

//初始化直接enter就好了

Enter currentpassword for root (enter for none):

OK, successfullyused password, moving on...

Setting the rootpassword ensures that nobody can log into the MariaDB

root user withoutthe proper authorisation.

Set root password?

[Y/n] y

New password:

Re-enter newpassword:

Password updatedsuccessfully!

Reloading privilegetables..

... Success!

By default, aMariaDB installation has an anonymous user, allowing anyone

to log into MariaDBwithout having to have a user account created for

them. This isintended only for testing, and to make the installation

go a bit smoother. You should remove them before moving into a

productionenvironment.

Remove anonymoususers? [Y/n] y

... Success!

Normally, rootshould only be allowed to connect from 'localhost'. This

ensures that someonecannot guess at the root password from the network.

Disallow root loginremotely? [Y/n] y

... Success!

By default, MariaDBcomes with a database named 'test' that anyone can

access. This isalso intended only for testing, and should be removed

before moving into aproduction environment.

Remove test databaseand access to it? [Y/n] n

... skipping.

Reloading theprivilege tables will ensure that all changes made so far

will take effectimmediately.

Reload privilegetables now? [Y/n] y

... Success!

Cleaning up...

All done! If you'vecompleted all of the above steps, your MariaDB

installation shouldnow be secure.

Thanks for usingMariaDB!

[root@localhost ~]#

[root@localhost ~]#service mysqld restart

Shutting downMySQL.. SUCCESS!

Starting MySQL.SUCCESS!

[root@localhost~]# mysql -u root -p

Enter password:

Welcome to theMariaDB monitor. Commands end with ; or \g.

Your MariaDBconnection id is 5

Server version:10.0.19-MariaDB-log Source distribution

Copyright (c) 2000,2015, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>show tables

-> ;

ERROR 1046 (3D000):No database selected

MariaDB [(none)]>show databases;

+--------------------+

| Database |

+--------------------+

| information_schema|

| mysql |

| performance_schema|

| test |

+--------------------+

4 rows in set (0.04sec)

MariaDB [(none)]> //创建个測试库连接下

MariaDB [(none)]>create database r_test;

Query OK, 1 rowaffected (0.01 sec)

MariaDB [(none)]>grant all privileges on r_test.* to 'r_test'@'localhost' identifiedby 'r_test';

Query OK, 0 rowsaffected (0.00 sec)

MariaDB [(none)]>grant all privileges on r_test.* to 'r_test'@'%' identified by'r_test';

Query OK, 0 rowsaffected (0.00 sec)

用navicat连接下

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcnVpc2hlbmg=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

安装方式拜读參考:

http://www.linuxidc.com/Linux/2014-11/109049.htm

版权声明:本文博主原创文章,博客,未经同意不得转载。

centos7 设备 mariadb-10的更多相关文章

  1. CentOS7 yum方式安装MariaDB 10.2.13-1

    注:以下步骤都是以root身份运行. 一.建立mariadb.repo 1,编辑新文件,命令:vim  /etc/yum.repos.d/mariadb.repo 2,输入如下内容,保存退出 [mar ...

  2. CentOS7下安装Mariadb 10.3.17

    1. install lsb packagesudo yum install -y redhat-lsb 2.install net-tools packagesudo yum install -y ...

  3. Linux学习-基于CentOS7的MariaDB数据库的安装

    一.实验环境: 系统:CentOS7.6,关闭了防火墙与SELINUX 数据库版本:mariadb-10.2.25(二进制安装与源码安装) 二.安装方法: 1.yum源安装 (1) 配置yum源,官方 ...

  4. 从MySQL 5.5迁移到Mariadb 10.1.14

    从MySQL 5.5迁移到Mariadb 10.1.14 迁移计划如下: 1.备份MySQL 5.5的数据库,对指定库进行备份. 2.还原到Mariadb,然后建立复制. 3.然后就可以愿意啥时候切换 ...

  5. mariadb 10.2.3支持延时复制

    在mysql 5.6开始就支持延时复制,这在一些需要维护大量非标准化系统或者运维技术水平较低的公司和开发人员众多的项目组这是一个非常有价值的特性,可以说误操作的概率跟一个城市车祸概率的水平差不多了,我 ...

  6. MariaDB 10.1配置

    [mysqld]datadir=C:/Program Files/MariaDB 10.1/dataport=3306sql_mode="STRICT_TRANS_TABLES,NO_ENG ...

  7. Mariadb 10.1 joiner节点加入报错WSREP: Failed to prepare for incremental state transfer

    Mariadb 10.1 galera cluster 集群joiner 节点加入集群 会出现这种报错,导致mysql一直点点点,这里我贴出报错.2016年04月19日13:34:58 2016-04 ...

  8. centos7 安装mariaDB 以及 phpmyadmin的安装

    centos7 安装mariaDB 以及 phpmyadmin的安装 一:安装mariadb, mariadb 是 mysql 的一个分支,基本和mysql一样的 1. yum -y install ...

  9. mariadb 10 多源复制(Multi-source replication) 业务使用场景分析,及使用方法

    mariadb 10 多源复制(Multi-source replication) 业务使用场景分析,及使用方法 官方mysql一个slave只能对应一个master,mariadb 10开始支持多源 ...

  10. SQLServer2012 和 MariaDB 10.0.3 分页效率的对比

    1. 实验环境      R910服务器, 16G内存 SqlServer 2012   64bit MariaDB 10.0.3   64bit  (InnoDB) 2. 实验表情况 rtlBill ...

随机推荐

  1. poj 3415 Common Substrings

    题目链接:http://poj.org/problem?id=3415 题目分类:后缀数组 题意:给出两个串和一个数字k,求两个串的公共字串大于等于k的数目 代码: //#include<bit ...

  2. 8张图理解Java(转)

    一图胜千言,下面图解均来自Program Creek 网站的Java教程,目前它们拥有最多的票选.如果图解没有阐明问题,那么你可以借助它的标题来一窥究竟. 1.字符串不变性 下面这张图展示了这段代码做 ...

  3. Java基础之数组序列化、反序列化 小发现(不知道 是不是有问题)

    结论:  数组,无论是否声明为transient,都是可以序列化.反序列化的. 测试情况如下: 1.两种类型的数组:int .String: 2 声明为transient  或者不做任何修饰:. 3. ...

  4. HTML5 Canvas动画效果实现原理

    在线演示 使用HTML5画布可以帮助我们高速实现简单的动画效果.基本原理例如以下: 每隔一定时间绘制图形而且清除图形,用来模拟出一个动画过程,能够使用context.clearRect(0, 0, x ...

  5. nginx源代码分析--event事件驱动初始化

    1.在nginx.c中设置每一个核心模块的index ngx_max_module = 0; for (i = 0; ngx_modules[i]; i++) { ngx_modules[i]-> ...

  6. ActiveReports 9 新功能:创新的设计分层报告

     在最新的ActiveReports 9报表控件添加了几个新功能,为了帮助您创建一个漂亮的外观在较短的时间内.强大的报表系统.本文重点讨论创新的分层设计报告,分组报告内容管理和设计,于实现报表套打 ...

  7. C++ 多态性分析

    编译 - 时间多态性--函数重载 编译后的中间代码(例如GCC产生.o文件.此时还不是汇编语言)函数名字有变化,看以下两个样例. void cc_show(const char*str)     -& ...

  8. SCU 3132(博弈)

    传送门:windy和水星 -- 水星游戏 1 题意:在一张由 n*m 的格子组成的棋盘上放着 k 个骑士每个骑士的位置为(xi,yi),表示第xi行,第yi列骑士如果当前位置为(x,y),一步可以走的 ...

  9. https原理及tomcat配置https方法

    一. 什么是HTTPS 在说HTTPS之前先说说什么是HTTP,HTTP就是我们平时浏览网页时候使用的一种协议.HTTP协议传输的数据都是未加密的,也就是明文的,因此使用HTTP协议传输隐私信息非常不 ...

  10. Hama学习总结

    Hama学习笔记 1.       Hama定义 Hama是基于HDFS上的BSP模型实现,其执行不须要MapReduce. 例证例如以下: 在单点调试的Hama系统上,仅仅执行NameNode.Da ...