首页 > 其他分享 >Mariadb安装

Mariadb安装

时间:2023-07-24 15:24:00浏览次数:38  
标签:... Mariadb Success 安装 should MariaDB password root

1、配置Yum源

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

2、安装并加入开机自启

yum install -y mariadb mariadb-server
systemctl enable --now mariadb

3、初始化Maridb

[root@localhost ~]# 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): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
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   禁止root用户远程登录
 ... 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!

4、登录验证

[root@localhost ~]# mysql -uroot -p
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.68-MariaDB MariaDB Server

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

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

MariaDB [(none)]> show databases\
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

  

  

  

  

标签:...,Mariadb,Success,安装,should,MariaDB,password,root
From: https://www.cnblogs.com/isxiefeng/p/17577326.html

相关文章

  • nginx安装
    安装:https://blog.csdn.net/tiansyun/article/details/130601293解决无法查看版本:https://www.likecs.com/show-308153278.html两台虚拟机实现负载均衡:https://blog.csdn.net/weixin_44549096/article/details/122142920 ......
  • 通过docker安装的jira提示We've detected a potential problem with JIRA's Dashboard
    正常通过docker安装jira后,访问是不会出问题的但是如果使用nginx代理后,就是在nginx里配置了proxy_passhttp://localhost:2800再访问后,就会报错We'vedetectedapotentialproblemwithJIRA'sDashboardconfigurationthatyouradministratorcancorrect.Clickhereto......
  • 通过yum安装Openresty
    Openresty官网:http://openresty.org/cn/1、下载yum-utilsyuminstallyum-utils-y2、添加openresty的repoyum-config-manager--add-repohttps://openresty.org/package/centos/openresty.repo安装Openrestyyuminstallopenresty-y安装后,查看一下版本号resty-V可以......
  • 给服务器安装系统点滴
    给公司测试服务器升级操作系统颇为周折,以前一帆风顺的操作,反复的折腾了几日,特记录下来;(服务器硬盘分区格式为MBR)一开始想用工具Ventoy制作一个多系统安装U盘,按使用说明设置分区类型为MBR,将操作系统复制到U盘根目录下;但实际安装过程中并不能友好的自动进行,进行到选择分区时,直接提......
  • 1.Docker基础及自动安装
    docker的介绍和基础操作docker单机容器dockercompose单机多个容器k8s多机多个容器container即容器,集装箱docker就是搬运集装的码头工人,管理容器的管理工具Docker的组成:Docker主机(Host):一个物理机或虚拟机,用于运行Docker服务进程和容器,也称为宿主机,node节点Docker......
  • 在android虚拟机中安装app
    在Android虚拟机中安装App在Android开发中,我们经常需要在虚拟机中安装App以进行调试和测试。本文将介绍如何在Android虚拟机中安装App,并提供代码示例。创建虚拟机首先,我们需要创建一个Android虚拟机。可以使用AndroidStudio提供的虚拟设备管理器来创建和管理虚拟机。以下是创建......
  • 设置pip的安装源
    windows一般有两个位置C:\Users\<YourUsername>\.pip\pip.iniC:\Users\<YourUsername>\AppData\Roaming\pip\pip.inilinux/etc/pip.conf~/.pip/pip.conf~/.pip.conf内容[global]timeout=6000index-url=http://pypi.douban.com:80/simple/trust......
  • jadx安装与配置,hook框架frida
    jadx1.下载jadx反编译工具,安装(解压即用)#下载地址:https://github.com/skylot/jadx/releases2.打开jadx反编译工具:3.抓包与代码定位3.1抓包#1.安装apk#2.打开chaarles,打开app,定位到登录请求3.2.反编译定位代码的位置#抓包#想去反编译代码中的位置......
  • finalShell的安装和使用
    finalshell的下载链接:https://pan.baidu.com/s/17D7oZ3xo24lnmFJ_amXdBA提取码:86ym1、finalshell的安装安装步骤很简单,下一步,下一步,安装完即可,存放路径,建议不要存放在c盘2、操作步骤2.1打开工具 2.2 修改快捷键 获取结束之后,点击确认使用以上方式,将系统原来默认......
  • linux安装源码包指定安装目录【转载】
    本文来自博客园,作者:阿弱,转载请注明原文链接:https://www.cnblogs.com/aruo/p/15771915.html当下载完一个源码包并且解压后文件夹下会有一个重要的文件configureconfigure文件是一个可执行的脚本文件,它将检查目标系统的配置和可用功能,比如一些检查依赖或者启用禁用一些模块,它有......