英文:
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' 不应该是可以的。相反,创建另一个超级用户,允许所有访问权限,然后尝试使用该用户连接。
- 创建用户 'sammy'@'%' IDENTIFIED BY 'password';
- GRANT ALL PRIVILEGES ON . TO '
'@'%' WITH GRANT OPTION; - 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.
CREATE USER 'sammy'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO '<user>'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
This should do the trick.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论