二进制安装指定版本的MariaDBv10.11.6

ops/2025/3/13 21:01:56/

一、官网下载mariadb安装包

Download MariaDB Server - MariaDB.org

找到对应的版本

下载安装包后上传到服务器这里不再赘述。

二、安装二进制包

1、解压安装包

2、查看安装包内的安装提示文档根据提示文档进行安装

# 解压安装包
tar xf mariadb-10.11.6-linux-systemd-x86_64
# 进入安装包
d Testing."
mariadb-10.11.6-linux-systemd-x86_64]# ls
bin      CREDITS  include         lib  mysql-test  README-wsrep  share      support-files
COPYING  docs     INSTALL-BINARY  man  README.md   scripts       sql-bench  THIRDPARTY
mariadb-10.11.6-linux-systemd-x86_64]# head -n 10 INSTALL-BINARY 
MariaDB and MySQL have identical install methods. In this document we
describe how to install MariaDB.The full documentation for installing MariaDB can be found at
https://mariadb.com/kb/en/library/binary-packages/
However most documentation at www.mysql.com also applies.2.2. Installing MariaDB from Generic Binaries on Unix/LinuxThis section covers the installation of MariaDB binary distributions

3、复制目录到/usr/local下

4、创建MySQL用户,给目录授权MySQL权限

# 把安装目录复制到/usr/local下 这里可以任意目录
cp -r mariadb-10.11.6-linux-systemd-x86_64 /usr/local/mysql
# 创建MySQL用户 授予MySQL权限
useradd mysql
chown -R mysql:mysql /usr/local/mysql/# 创建日志目录
mkdir -p /var/log/mariadb
cd /var/log/
chown mysql:mysql mariadb

5、初始化数据库

 mysql]# cd /usr/local/mysql/mysql]# scripts/mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OKTo start mariadbd at boot time you have to copy
support-files/mariadb.service to the right place for your systemTwo all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudoSee the MariaDB Knowledgebase at https://mariadb.com/kbYou can start the MariaDB daemon with:
cd '.' ; ./bin/mariadb-safe --datadir='/var/lib/mysql'You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mariadb-test-run.plPlease report any problems at https://mariadb.org/jiraThe latest information about MariaDB is available at https://mariadb.org/.Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

6、配置系统服务

# 启动数据库
bin/mysqld_safe --user=mysql &# 把启动服务加到服务里
cd /usr/local/mysql/support-files
sudo cp mysql.server /etc/init.d/mariadb
sudo chmod +x /etc/init.d/mariadb
sudo systemctl enable mariadb
sudo systemctl start mariadb  # 这里启动会一直卡着直接ctrl退出就好了

致此安装完成

三、验证服务

配置账号密码及权限

bin]# cd /usr/local/mysql/bin
bin]# ./mariadb -uroot -p --socket=/var/lib/mysql/mysql.sock
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.11.6-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123qweASD';
Query OK, 0 rows affected (0.002 sec)MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

用另外一台mysql登录验证账号密码及权限

# 输入正确的密码
mysql]# mysql -uroot -p -h 10.50.11.120 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.11.6-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> # 输入错误的密码
mysql]# mysql -uroot -p -h 10.50.11.120 
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'10.50.78.121' (using password: YES)


http://www.ppmy.cn/ops/165513.html

相关文章

解锁DeepSpeek-R1大模型微调:从训练到部署,打造定制化AI会话系统

目录 1. 前言 2.大模型微调概念简述 2.1. 按学习范式分类 2.2. 按参数更新范围分类 2.3. 大模型微调框架简介 3. DeepSpeek R1大模型微调实战 3.1.LLaMA-Factory基础环境安装 3.1大模型下载 3.2. 大模型训练 3.3. 大模型部署 3.4. 微调大模型融合基于SpirngBootVue2…

conda常用指令整理(持续更新...)

conda常用指令整理 此笔记涵盖conda常用指令,pip、命令行等常用指令。 1.查看conda版本 在Anaconda PowerShell Prompt中输入 conda --version2.创建新python虚拟环境 此python虚拟环境会存储在conda的envs中名为project_name的文件夹下 conda create --name …

SpringBoot实现文件上传

1. 配置文件上传限制 application.yml spring:servlet:multipart:max-file-size: 10MBmax-request-size: 10MB2. 创建文件上传控制器 import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import…

【spring】springAOP

1.基本概念 AOP即面向切面编程,它利用的是一种横切技术,解剖开封装的对象内部,并将那些影响多个类的公共行为封装到一个可重 用模块,这就是所谓的Aspect方面/切面。所谓的切面,简单点所说,就是将哪些与业务…

蓝桥杯省赛真题C++B组-裁纸刀2022

一、题目 问题描述 本题为填空题,只需要算出结果后,在代码中使用输出语句将所填结果输出即可。 小蓝有一个裁纸刀,每次可以将一张纸沿一条直线裁成两半。 小蓝用一张纸打印出两行三列共 6 个二维码,至少使用九次裁出来&#x…

解锁数据结构分享图:高效知识传播的关键

解锁数据结构分享图:高效知识传播的关键 在信息如洪流般涌来的时代,数据结构作为计算机科学的核心基石,其复杂性与重要性不言而喻。而数据结构分享图,则宛如一把神奇的钥匙,能够高效地打开理解数据结构知识宝库的大门…

特征表示深度解析:颜色、纹理、形状与编码

第一部分:颜色与纹理特征(Part 1) 1. 颜色特征 颜色直方图(Color Histogram) 定义:统计图像中各颜色通道(R/G/B)的像素分布,形成直方图。 计算步骤: 将每个…

简单工厂 、工厂方法模式和抽象工厂模式

简单工厂 、工厂方法模式和抽象工厂模式 1.模式性质与定位 简单工厂:并非正式的设计模式(属编程习惯),通过单一工厂类根据参数判断创建不同产品,本质是将对象创建逻辑集中管理。 工厂方法:是标准的创建型设计模式,定义抽象创建接口,由子类决定实例化哪个具体产品类,…