Debian 11安装mariadb-server
apt update
apt install mariadb-server
修改为任意地址访问
nano /etc/mysql/mariadb.conf.d/50-server.cnf
改为bind-address = 0.0.0.0
初始化数据库
mysql_secure_installation
允许远程访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '您的数据库密码' WITH GRANT OPTION;
flush privileges;
重启数据库
systemctl restart mariadb