一 MariaDB 安装
1.1 MariaDB 源配置
vim /etc/yum.repos.d/mariadb.repo
添加下面内容👇
[mariadb]
name=mariadb
baseurl=https://mirrors.ustc.edu.cn/mariadb/yum/10.10/centos7-amd64
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
[mariadb]
xx库的名称
name=库
baseurl=下载库的地址
gpgkey=密钥
gpgcheck=1开启校验
1.2 清空缓存
yum celan all # 清空缓存
yum makecache # 建立缓存
1.3 安装MariaDB
yum -y install mariadb-server mariadb-client

二 MariaDB 基本配置
2.1 启动MariaDB
systemctl start mariadb # 启动
systemctl enable mariadb # 开机自启
2.2 MariaDB 进程查看
yum -y instal net-tools # 安装net工具
netstat -ntlp | grep 3306


2.3 MariDB 数据库初始化
为了数据库的安全性和正常运行,初始化操作涉及
5个步骤
1.设置root管理员在数据中的密码(默认为空,直接回车)
2.设置root管理员在数据库中的专有密码
3.删除匿名用户,使用root管理员远程登录数据库,确保安全性
4.删除默认的测试数据库,取消测试数据库的全部访问权限
5.刷新授权列联表,让初始化立即生效
2.3.1 数据库初始化
mysql_secure_installation
Enter current password for root (enter for none): #初次运行直接回车设置密码
Switch to unix_socket authentication [Y/n] #输入y并回车
Change the root password? [Y/n] #输入y并回车
New password: #设置root用户密码
Re-enter new password:
5445



被折叠的 条评论
为什么被折叠?



