原文: Debian 11 Bullseye通过apt-get安装Mariadb 10.7。
在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无法进行远程连接情形排查分析。
参考:
- https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/