mariadb设置远程访问

编辑 /etc/mysql/my.cnf文件,添加以下代码

复制代码
[mysqld]
bind-address = 0.0.0.0

在mariadb中添加一个用于远程访问的新用户

先进入mariadb

复制代码
mysql -u root -p

创建用户

sql 复制代码
// 创建用户
create user 'remote_user'@'%' identified by 'password';
// 给远程访问权限
grant all privileges on *.* to 'remote_user'@'%' with grant option;

重启服务

sql 复制代码
sudo systemctl restart mariadb

搞定

相关推荐
lwx9148522 小时前
Linux-特殊权限SUID,SGID,SBIT
linux·运维·服务器
清风徐来QCQ2 小时前
Lombok/SSM/devTools
数据库
LaughingZhu3 小时前
Product Hunt 每日热榜 | 2026-04-05
前端·数据库·人工智能·经验分享·神经网络
2601_949814693 小时前
使用mysql报Communications link failure异常解决
数据库·mysql
搜佛说3 小时前
02-第2章-核心概念与架构
数据库·物联网·微服务·架构·边缘计算·iot
小义_4 小时前
随笔 3(Linux)
linux·运维·服务器·云原生·红帽
C'ᴇsᴛ.小琳 ℡5 小时前
高性能NoSQL
数据库·nosql
cccccc语言我来了5 小时前
Linux(10)进程概念
linux·运维·服务器
i220818 Faiz Ul5 小时前
动漫商城|基于springboot + vue动漫商城系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·动漫商城系统
iNgs IMAC5 小时前
redis 使用
数据库·redis·缓存