yum安装mariadb(CentOS7)

1、安装软件包

yum install mariadb mariadb-server -y

2、编辑vim

/etc/my.cnf.d/mariadb-server.cnf并完成以下操作
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
bind-address = 192.168.10.10
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

3、设置服务开机启动

systemctl enable mariadb.service
systemctl start mariadb.service

4、通过运行mysql_secure_installation脚本来保护数据库服务。

[[email protected] ~]# 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!

原文地址:https://www.cnblogs.com/liangjingfu/p/9355846.html

时间: 2024-10-12 22:37:58

yum安装mariadb(CentOS7)的相关文章

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

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

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

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)了 .没什么技术含量的解决

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

使用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.

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 yum安装 mariadb

从最新版本centos7开始,默认的是 Mariadb而不是mysql! 使用系统自带的repos安装很简单: yum install mariadb mariadb-server systemctl start mariadb ==> 启动mariadb systemctl enable mariadb ==> 开机自启动 firewall-cmd --permanent --add-port=3306/tcp ==> 开放端口,允许远程访问 systemctl restart fir