Linux学习篇第三章之~mariadb

这篇博客详细介绍了在Linux系统中如何安装、配置、管理以及安全初始化Mariaadb数据库。内容包括使用yum安装数据库,启动服务,设置root密码,查看端口,编辑配置文件,安全初始化,创建数据库,建立表,插入数据,用户授权,以及使用网页管理工具phpMyAdmin。还讲解了如何修改忘记的超级用户密码。
摘要由CSDN通过智能技术生成

Mariadb数据库

 安装Mariadb数据库

 配置和管理数据库
 配置数据库用户和访问权限

 备份和恢复数据库

1.Mariadb安装

> yum install mariadb-server -y      ####下载数据库软件

> systemctl start mariadb          #####开启服务

> mysql                      ####进入到数据库中

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit
Bye
> netstat -antlpe | grep mysql     ####查看mysql端口情况
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN     27         76495      3536/mysqld         
> vim /etc/my.cnf    #####编写配置文件,屏蔽网络接口


[root@mariadb ~]# systemctl restart mariadb   
[root@mariadb ~]# netstat -antlpe | grep mysql   #####查看mysql服务
[root@mariadb ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit
Bye

> mysql_secure_installation     ###安全初始化
Set root password? [Y/n] Y     #####设置root用户密码
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
Remove anonymous users? [Y/n] Y      #####删除匿名用户
 ... Success!
Disallow root login remotely? [Y/n] Y  #####不允许远程用户登录
 ... Success!
Remove test database and access to it? [Y/n] Y  ######删除测试数据库


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值