允许远程访问MariaDB。

huangapple go评论57阅读模式
英文:

Grant remote access for MariaDB

问题

I am new to all this. Installed MariaDB and HeidiSQL on Windows server B and all running fine. I need to grant access for Windows server A to access the database with HeidiSQL. I ran this query.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'A' IDENTIFIED BY 'root_pw_on_B' WITH GRANT OPTION; FLUSH PRIVILEGES;

From server A I still get "Host A not allowed to connect to this MariaDB server" when setting up a session in HeidiSQL.

Both servers are on-prem.

英文:

I am new to all this. Installed MariaDB and HeidiSQL on Windows server B and all running fine. I need to grant access for Windows server A to access the database with HeidiSQL. I ran this query.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'A' IDENTIFIED BY 'root_pw_on_B' WITH GRANT OPTION;
FLUSH PRIVILEGES;

From server A I still get "Host A not allowed to connect to this MariaDB server" when setting up a session in HeidiSQL.

Both servers are on-prem.

答案1

得分: 0

以下是已翻译的内容:

所以有几件事情,你正试图从任何地方授予 root 访问权限。这是一种极不安全的做法。'root'@'A' 不应该是可以的。相反,创建另一个超级用户,允许所有访问权限,然后尝试使用该用户连接。

  1. 创建用户 'sammy'@'%' IDENTIFIED BY 'password';
  2. GRANT ALL PRIVILEGES ON . TO ''@'%' WITH GRANT OPTION;
  3. FLUSH PRIVILEGES;

这应该可以解决问题。

英文:

So couple of things, you are trying to grant root access from anywhere. That is a highly insecure practice. 'root'@'A' should not be okay. Instead create another super user, allow all access and then try to connect using that user.

  1. CREATE USER 'sammy'@'%' IDENTIFIED BY 'password';
  2. GRANT ALL PRIVILEGES ON *.* TO '<user>'@'%' WITH GRANT OPTION;
  3. FLUSH PRIVILEGES;

This should do the trick.

huangapple
  • 本文由 发表于 2023年6月5日 06:44:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76402694.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定