【发布时间】:2014-07-10 03:19:14
【问题描述】:
我似乎在使用 Ansible 并创建用户并为其设置远程权限时遇到问题。我正在尝试创建一个通过单独的 API 服务器远程访问特定数据库服务器的用户。
mysql_user: login_user=root login_password=password name=sampleUser password=password priv=sampleDatabase.'192.168.33.8':ALL state=present
我做...priv=sampleDatabase.*:All...时一切正常
Ansible 在控制台中抛出的错误似乎取消了格式设置,如下所示:
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.168.33.8 TO 'sampleDatabase'@'localhost'' at line 1")
我可以确认在没有 Ansible 的情况下在 mysql 控制台中手动执行相同的相等功能。
【问题讨论】:
-
这可能无济于事,但请尝试双引号“prov”的有效负载。
标签: mysql remote-access ansible