应用管理-数据库服务基础

本文详细介绍了如何构建和管理MariaDB数据库系统,包括安装mariadb-server、设置root用户密码、限制服务仅对本地主机开放,以及进行基本的数据库创建、删除和使用。此外,还涉及到了数据库导入导出和用户授权等关键操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 构建数据库系统

    • 什么是数据库
    • 部署mariadb数据库服务器
      • 安装mariadb-server软件包
      • 重启mariadb服务
    • 访问mariadb
      • [root@localhost ~]# mysql
        Welcome to the MariaDB monitor. Commands end with ; or \g.
        Your MariaDB connection id is 2
        Server version: 5.5.68-MariaDB MariaDB Server

        Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

        MariaDB [(none)]>

  • 基本管理操作

    • mariadb服务端配置调整
      • 设置数据库管理员root密码
        • 格式:mysqladmin [-u 用户名] [-p旧密码] password ‘新密码’
        • [root@localhost ~]# mysqladmin -u root password ‘123’
          [root@localhost ~]# mysql -u root -p123
      • 禁止监听,只服务本机
        修改/etc/my.cnf
    • 用户信息存储在mysql-user表中
    • 数据库的增删查
      • 创建库
        MariaDB [(none)]> create database nsd1905;
        Query OK, 1 row affected (0.00 sec)
      • 删除库
        MariaDB [(none)]> drop database nsd1905;
      • 进入库
      • MariaDB [(none)]> use mysql;
    • 数据库的多处/导入操作
    • 用户授权设置
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值