如何在memsql安装后更改root密码?

Gab*_*ana 4 singlestore

我已经安装了MemSQL社区版(单主机群集),一切运行良好.我需要允许远程访问数据库,但MemSQL在没有密码的情况下安装用户root.如果我打开防火墙上的3306端口,memSQL很乐意允许任何人以root身份登录而无需密码.

我试图通过更改root用户密码

mysqladmin -u root -h 127.0.0.1  password abc123
Run Code Online (Sandbox Code Playgroud)

但我得到的错误

mysqladmin: unable to change password; error: 'Unknown system variable 'password''
Run Code Online (Sandbox Code Playgroud)

我也尝试在以root身份连接后进行更改.所有这些都失败了:

mysql> SET PASSWORD = 'abc123';
ERROR 1193 (HY000): Unknown system variable 'PASSWORD'

mysql> SET PASSWORD = PASSWORD('abc123');
ERROR 1064 (42000): 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 '('abc123')' at line 1

mysql> SET PASSWORD = OLD_PASSWORD('abc123');
ERROR 1064 (42000): 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 '('abc123')' at line 1
Run Code Online (Sandbox Code Playgroud)

所以我被卡住了.MemSQL的文档在这个问题上也非常轻量级,而且它们似乎没有社区页面,我可以在这里询问这个问题.我认为这是非常简单的,我正在尝试做,不知道为什么它如此困难,而且就此而言,我不确定为什么MemSQL根本就没有安全性.

有任何想法吗?

小智 6

在2015年6月发布的MemSQL Ops中,您现在可以使用该memsql-update-root-password命令使用一个命令更改root密码.有关更多信息,请参阅以下链接

我希望这有帮助!


Ish*_*ael 5

在MemSQL中更改用户的密码,您应该使用以下GRANT命令:

grant all on *.* to 'root'@'localhost' identified by 'password' with grant option;
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
Run Code Online (Sandbox Code Playgroud)

请参阅GRANT命令的手册以及配置群集安全性的非常详细的手册:

http://docs.memsql.com/latest/ref/GRANT/

http://docs.memsql.com/latest/admin/security/#configuring-password-security