下载地址:

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连接下

安装方式拜读參考:

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

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

转载于:https://www.cnblogs.com/blfshiye/p/4842606.html

centos7 设备 mariadb-10相关推荐

  1. CentOS7安装MariaDB 10.4x

    CentOS7安装MariaDB 10.4x 1.下载安装包 2.按顺序安装依赖环境包 2.1 安装依赖环境包: yum install rsync nmap lsof perl-DBI nc 2.2 ...

  2. centos7下载MariaDB 10.5

    1.添加 MariaDB YUM 存储库 curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup sudo bash ...

  3. 【MariaDB】MariaDB 10.7.3二进制包安装

    1.上传MariaDB 10.7.3二进制包到/usr/local/src目录下 # cd /usr/local/src/ # rz rz waiting to receive. Starting z ...

  4. CentOS7安装MariaDB的流程步骤

    安装前需要彻底清除你的服务器计算机上原来安装过的mysql.maraidb的文件,不然会出现各种问题. CentOS7安装MariaDB的流程步骤如下: ======================= ...

  5. centos7安装mariadb

    Mariadb 1.配置数据库yum源 [root@web-001 ~]# cat /etc/yum.repos.d/MariaDB.repo # MariaDB 10.1 CentOS reposi ...

  6. MySQL · 社区动态 · MariaDB 10.2 前瞻

    继 MariaDB 10.1 之后,对标 MySQL 5.7 的 MariaDB 10.2 版本也即将封板,那么我们就来看看新的版本有哪些新的功能吧. 之前的月报我们写过一篇关于 Window Fun ...

  7. mariadb 10.1查看per connection内存消耗

    在mariadb 10.1版本中,在information_schema.processlist表中,新增了几个字段,其中有一个memory_used,其记录的是连接的内存消耗. 同时新增了一个状态变 ...

  8. MySQL 5.7.17 VS MariaDB 10.1.19 Enterprise性能压测

    为了验证MariaDB官网压测结果,特找了三台低配物理机做压测 https://mariadb.org/maria-10-1-mysql-5-7-commodity-hardware/ 192.168 ...

  9. MariaDB 10.0 和 MySQL 5.6 有何不同

    去年的5月,我第一次在博客上介绍了关于MariaDB 10.0. 我们当时收到很多的反馈,在进行众人意见总结后,我们再次的更加深入的解释过MariaDB 10.0. 在新的一年的伊始,随着MariaD ...

  10. mariadb 10.2.3支持延时复制

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

最新文章

  1. java命名规则_Java命名规则
  2. python compileall 打包发布
  3. stateOffset
  4. 在linux内核3.14.43添加自己的驱动源码,linux内核如何加入自己的驱动
  5. android动画超出圆角,Android关于Glide的使用(高斯模糊、加载监听、圆角图片)
  6. 数据3分钟丨墨天轮2021年度数据库奖项及中国数据库魔力象限等多项成果发布...
  7. (03)System Verilog 常用数据类型详解
  8. 基于JAVA+SpringMVC+Mybatis+MYSQL的停车场管理系统
  9. 深入了解C++变量类型有哪些
  10. mac/linux下java项目使用本机自带ssh和scp命令,自动复制上传并部署的脚本
  11. 降维(Dimensionality Reduction) 是机器学习中的一种重要的特征处理手段
  12. 【转】TinyXML2 入门教程
  13. 2019年‘泰迪杯’数据分析职业技能大赛A题——个人代码分享
  14. OrCAD 与 Cadence Allegro PCB 入门 - 以 16.6版本为例 (3)
  15. 网站APP游戏被入侵渗透破解该怎么解决
  16. Metric评价指标-Embedding Similarity
  17. MyBatis 报错 Could not initialize class
  18. 计算机组成原理实验二 存储器实验
  19. list()与tolist()的区别
  20. 微博点击图片放大html,新浪微博图片放大效果[artZoom.js]

热门文章

  1. 给想进大厂的同学一条忠告!
  2. 提防最近一些公司的小九九!
  3. java string的内存模型_Java String内存模型
  4. 拷贝控制——拷贝、赋值与销毁
  5. Java语言程序设计基础篇第10版第5章习题答案
  6. Python实现装饰模式的一段代码
  7. group by having where order by
  8. junit4同一时候測试多个測试类
  9. 快速解决低版本Xcode不支持高版本iOS真机调试问题
  10. 日记【2010-6-2】