Debian 11 Bullseye通过apt-get安装Mariadb 10.7

realnode.png vps-under-title.png 科学上网教程 | 机场推荐 | 云深不知处(机场)

在Debian 11 Bullseye通过apt-get安装Mariadb 10.7过程记录如下。

一、环境信息

  • 系统:Debian GNU/Linux 11 (bullseye);
  • Mariadb 10.7;
  • 用户:winbert,非root用户;

二、安装

仓库构建:

winbert@winbert-debian:~$ curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
# [info] Checking for script prerequisites.
# [info] MariaDB Server version 10.7 is valid
# [info] Repository file successfully written to /etc/apt/sources.list.d/mariadb.list
# [info] Adding trusted package signing keys...
# [info] Running apt-get update...
# [info] Done adding trusted package signing keys

系统更新:

sudo apt update

执行安装:

sudo apt-get install mariadb-server mariadb-client

查看状态:

sudo systemctl status mariadb

设置密码:

sudo mysqladmin -u root password 'type_your_passord_here'

登录测试:

mysql -u root -p 

#然后根据提示输入你的密码

设置允许远程登录:

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> select user,host from user;
+-------------+-----------+
| User        | Host      |
+-------------+-----------+
| mariadb.sys | localhost |
| mysql       | localhost |
| root        | localhost |
+-------------+-----------+
3 rows in set (0.002 sec)

MariaDB [mysql]> grant all privileges  on *.* to root@'%' identified by "type_your_passord_here";
Query OK, 0 rows affected (0.002 sec)

MariaDB [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [mysql]> 

如果设置完成仍不能远程连接,请参考: MySQL无法进行远程连接情形排查分析

参考:

  1. https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
赞(0)
未经允许禁止转载:优米格 » Debian 11 Bullseye通过apt-get安装Mariadb 10.7

评论 抢沙发

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系

登录

找回密码

注册

Ads Blocker Image Powered by Code Help Pro

检测到广告已被屏蔽

尊敬的优米格用户,

您好,系统检测到您使用了广告屏蔽组件。本网站并不包含任何侵入性广告,如果本站能给您一点帮助,还请将本站加入拦截白名单,这是我们仅有的收入来源!

网站的持续运作和改进,需要您的慷概帮助,感谢您的支持。

此致,
优米格 团队