【安装】Linux Centos 或 Debian 离线安装指定版本MariaDB

【安装】Linux Centos 或 Debian 离线安装指定版本MariaDB

下载地址

https://mariadb.com/downloads/community/community-server/https://mirrors.aliyun.com/mariadb/yum/https://mariadb.com/downloads/community/community-server/

Download MariaDB Server - MariaDB.org

mariadb-yum安装包下载_开源镜像站-阿里云

  1. 下载安装包

centos

mariadb-11.4.2-rhel-7-x86_64-rpms.tar

复制代码
wget https://dlm.mariadb.com/3827291/MariaDB/mariadb-11.4.2/yum/centos/mariadb-11.4.2-rhel-7-x86_64-rpms.tar

Debian

选择对应的 Debian版本

mariadb-11.4.2-debian-bookworm-amd64-debs.tar

复制代码
wget https://dlm.mariadb.com/3825286/MariaDB/mariadb-11.4.2/repo/debian/mariadb-11.4.2-debian-bookworm-amd64-debs.tar

2.解压

复制代码
tar -xvf mariadb-11.4.2-rhel-7-x86_64-rpms.tar

3.进入该目录

复制代码
cd mariadb-11.4.2-rhel-7-x86_64-rpms/

4.执行 ./setup_repository

复制代码
./setup_repository

5.安装MariaDB

Centos安装命令

复制代码
yum -y install MariaDB-server

debian 安装命令

复制代码
apt install mariadb-server

安装成功

启动服务

复制代码
sudo systemctl start mariadb

配置安全控制程序

复制代码
mariadb-secure-installation

输入当前 root 密码,因为当前密码为空,直接回车

是否设置 root 密码,这里输入 y 表示设置密码,输入2次密码,显示 success 为成功

是否删除匿名用户,选择删除

是否禁止 root 用户远程登录数据库,设置为是

是否删除test数据库,这里为了后面测试选择不删除

是否重载授权表,选择是

重启服务

复制代码
sudo systemctl restart mariadb

停止服务

复制代码
sudo systemctl stop mariadb

默认安装目录

复制代码
/usr/share/mariadb/

准备工作

1.启动服务

2.修改root密码

复制代码
mysqladmin -u root -p password 新密码

刚开始没密码 所以直接两个回车就行

3.修改root外网可以访问

遇到的问题

库没了 只能看到这两个库了

原因是没权限

修改配置文件

/etc/my.cnf.d/server.cnf

复制代码
[mysqld]
skip-grant-tables

然后重启服务

屏蔽密码登录

>mysql -uroot -p

> use mysql;

>create user 'root'@'localhost';

ERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement

报错,输入命令刷新即可

>flush privileges ;

>create user 'root'@'localhost';

赋予所有权限 并且修改root密码为123456

>grant all privileges on *.* to 'root'@'localhost' identified by '123456' with grant option;

>flush privileges ;

相关推荐
wdfk_prog2 小时前
Wi-Fi Direct 教程 05:control socket 与 eloop——P2P_FIND 怎样进入 wpa_supplicant 命令解析器
运维·服务器·后端·网络协议·ubuntu·p2p·wifi-direct
Golden_Chen2 小时前
在 Ubuntu 上搭建 FTP 服务器
linux·运维·服务器
ZMacros2 小时前
Live-build方法构建debian和ubuntu
linux·ubuntu·debian
byte轻骑兵2 小时前
【BlueZ 】netlink 在 BlueZ 中的应用:用户态与内核态的配置消息传递
linux·bluez·电脑蓝牙·嵌入式蓝牙
xbzb2 小时前
Nginx 反向代理总 404?Location 匹配与 proxy_pass 尾斜杠避坑手册
linux·运维·nginx·虚拟主机
Elastic 中国社区官方博客3 小时前
14 个 alerts,1 个 incident:使用 Elasticsearch 中的 ES|QL 衡量 alerting rule 噪声
大数据·运维·数据库·elasticsearch·搜索引擎·全文检索
Lsetea3 小时前
OpenSSL报permitted subtree violation:证书SAN与CA名称约束排查
运维·https·ssl证书·openssl·证书链
ShayneLee83 小时前
Nginx只开一个端口!能做什么?(一)
运维·nginx
万联WANFLOW3 小时前
Docker Hub 镜像拉取慢、timeout 的排查方法
运维·docker·云原生·容器·eureka
Julien20043 小时前
CGroups 资源控制组
linux·运维·服务器·ssh·学习方法