欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > 能源 > 【安装】Linux Centos7.9 离线安装指定版本MariaDB

【安装】Linux Centos7.9 离线安装指定版本MariaDB

2025/4/19 14:38:20 来源:https://blog.csdn.net/G971005287W/article/details/140768995  浏览:    关键词:【安装】Linux Centos7.9 离线安装指定版本MariaDB

【安装】Linux Centos7.9 离线安装指定版本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. 下载安装包

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

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

yum -y 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 ;

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词