当前位置: 首页 > news >正文

CentOS安装mariadb

1、 安装

[root@localhost ~]#  yum install mariadb mariadb-server

2、 启动并自启

[root@ecs-3f21 ~]# systemctl enable mariadb –now

3、 查看启动状态

[root@ecs-3f21 ~]# systemctl status mariadb

4、 初始化mariadb并设置root密码

[root@ecs-3f21 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS 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				# 是否设置密码。输入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			#是否移除匿名用户,选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		#是否移除测试数据库选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!

5、 配置文件及日志所在

配置文件:	/etc/my.cnf
日志文件:	/var/log/mariadb/mariadb.log

mariadb 完全兼容mysql,命令一样!

http://www.lryc.cn/news/173297.html

相关文章:

  • FPGA——基础知识合集
  • 【pytest】 标记冒烟用例 @pytest.mark.smoke
  • 数据结构入门-14-排序
  • Gin学习记录4——Controller和中间件
  • FL Studio21.2中文版数字音乐制作软件
  • ELK 企业级日志分析系统 ELFK
  • IDEA中创建Java Web项目方法1
  • 源码:TMS FlexCel Studio for .NET 7.19
  • 多输入多输出 | MATLAB实现PSO-BP粒子群优化BP神经网络多输入多输出
  • 操作系统:系统引导以及虚拟机
  • AIGC绘本——海马搬家来喽
  • strtok()函数的使用方法
  • Matlab中的handle 类
  • C#,数值计算——Multinormaldev的计算方法与源程序
  • 软件项目测试用例评审
  • 图像处理与计算机视觉--第二章-成像与图像表示-8问
  • python中使用多线程批量导入包
  • 齿轮减速机设备类网站pbootcms模板(PC端+手机端自适应)
  • MySQL报错:this is incompatible with sql_mode=only_full_group_by 解决方法
  • impala常用时间函数,date->string->timestamp互转
  • 无源供电无线测温系统的应用意义
  • 使用 PyTorch 的计算机视觉简介 (1/6)
  • 用PHP实现极验验证功能
  • 【数据结构初阶】三、 线性表里的链表(无头+单向+非循环链表)
  • Mybatis 映射器与XML配置职责分离
  • 微服务引擎
  • 前端JavaScript入门到精通,javascript核心进阶ES6语法、API、js高级等基础知识和实战 —— JS基础(三)
  • 搭建部署属于自己的基于gpt3.5的大语言模型(基于flask+html+css+js+mysql实现)
  • AI创作专家,免费的AI创作专家工具
  • Nginx之gzip模块解读