用yum安装mariadb

当前系统:centos7.1mini

在/etc/yum.repos.d/MariaDB.repo添加MariaDB yum源

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

安装mariadb:

yum install MariaDB-server MariaDB-client

安装完成后启动mariadb服务

service mariadb start

或者

systemctl start mariadb

mariadb安装后需要设置安全,包括密码,匿名用户等

在shell窗口无参数执行如下命令:

mysql_secure_installation

[[email protected] toolcase]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we‘ll need the current
password for the root user.  If you‘ve just installed MariaDB, and
you haven‘t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from ‘localhost‘.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named ‘test‘ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you‘ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

grant语句创建用户并授权

  GRANT语句的语法看上去像这样:

  GRANT privileges (columns) ON what TO user IDENTIFIED BY "password" WITH GRANT OPTION

  要使用该语句,你需要填写下列部分:

  privileges

  授予用户的权限,下表列出可用于GRANT语句的权限指定符:

  权限指定符 权限允许的操作

  ALTER 修改表和索引

  CREATE 创建数据库和表

  DELETE 删除表中已有的记录 

详细信息请参考链接grant

时间: 2024-08-02 23:07:27

用yum安装mariadb的相关文章

Centos 使用YUM安装MariaDB

1.在 /etc/yum.repos.d/ 下建立 MariaDB.repo,内容如下: [[email protected] etc]$ cd /etc/yum.repos.d [[email protected] yum.repos.d]$ vi MariaDB.repo 拷贝以下内容: # MariaDB 10.0 CentOS repository list - created 2013-08-23 13:08 UTC # http://mariadb.org/mariadb/repos

CentOS7下使用yum安装MariaDB

CentOS 6 或早期的版本中提供的是 MySQL 的服务器/客户端安装包,但 CentOS 7 已使用了 MariaDB 替代了默认的 MySQL.MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品. Linux下安装MariaDB官方文档参见:https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum

CentOS通过yum安装MariaDB(MySQL)无法启动服务或者找不到mysql.sock

转载自:http://www.linuxidc.com/Linux/2016-03/129396.htm 今天在Linux主机(CentOS 7)安装(yum install方式)Mariadb(即开源MySQL)后,无法启动mariadb,其实是安装不完整,当然启动不了,更不用说输入"mysql -u root"提示Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)了 .没什么技术含量的解决

使用yum安装MariaDB

添加MariaDB的YUM源 基于YUM的Linux发行版的YUM源,使用在线的源生成器可以轻松地为你的发行版生成正确的MariaDB.repo, 不同系统版本yum源生成器: https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna&distro=CentOS 目前有CentOS 5, CentOS 6, RHEL 5, RHEL 6, Fedora 16, and Fedora 17的YUM源. 把生成了 MariaDB.

ECS——CentOS7下使用yum安装MariaDB

CentOS 6 或早期的版本中提供的是 MySQL 的服务器/客户端安装包,但 CentOS 7 已使用了 MariaDB 替代了默认的 MySQL.MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品. Linux下安装MariaDB官方文档参见:https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum

Centos6下使用yum安装MariaDB

1)增加mariaDB的yum源 1 2 3 4 5 6 7 8 9 [[email protected] ~]# cd /etc/yum.repos.d/ [[email protected] yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak [[email protected] yum.repos.d]# vim CentOS-Base.repo ...... [mariadb]    name = MariaDB baseurl

yum安装Mariadb,二进制安装Mariadb

yum安装Mariadb 设置Mariadb的yum源 vim /etc/yum.repos.d/mariadb.repo [mariadb] name=mariadb baseurl=https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.2/centos7-amd64/ gpgcheck=0 使用清华yum源安装Mariadb,可以选择不同的版本,此处安装10.2.23 yum install mariadb-server 二进制安装Maria

Centos7.4 yum 安装MariaDB

#系统及版本选择:https://downloads.mariadb.org/mariadb/repositories/#mirror=tunavim /etc/yum.repos.d/MariaDB.repo[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.2.4/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1 yum -y i

Centos7 使用yum安装MariaDB与MariaDB的简单配置与使用

一.mariadb的安装 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可. 开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区采用分支的方式来避开这个风险. MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品. 方法1:阿里源下yum安装mariadb版本会旧一点 Red Hat Enterprise Linux/CentOS 7.0 发行版已将默认的数据库从 M