4

I've installed MemSQL community edition (single host cluster) and all is working well. I need to allow remote access to the database, but MemSQL installs the user root without a password. If I open up the 3306 port on the firewall, memSQL happily allows anyone to log in as root without a password.

I've tried to change the root user password via

mysqladmin -u root -h 127.0.0.1  password abc123

but I get the error of

mysqladmin: unable to change password; error: 'Unknown system variable 'password''

I also tried to change after connecting as root. all of these fail:

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

So I'm stuck. The docs for MemSQL are pretty lightweight on this issue as well, and they don't seem to have a community page where I can ask about this. I figure it's something really simple that I'm trying to do, not sure why it's so difficult, and for that matter, I'm not sure why MemSQL defaults to no security at all.

Any ideas?

4

4 回答 4

6

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

我希望这有帮助!

于 2015-07-07T18:10:31.193 回答
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;

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

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

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

于 2015-05-24T06:42:26.203 回答
1

尝试

mysql --user=root --password=abc123 --host=127.0.0.1
or
mysql -u root -p abc123 -h 127.0.0.1

参考:Mysql 手册页。

您可以使用以下命令更改 root 密码:

GRANT ALL ON *.* TO "root"@"%" IDENTIFIED BY 'password' WITH GRANT OPTION
于 2015-05-24T05:11:44.617 回答
0

在 mysql 中更改 root 用户的密码时,我观察到一件奇怪的事情,如下所示。

mysqladmin -u root password 'mypassword'

错误为

mysqladmin: unknown variable 'database=mydatabase'

原因是 mydatabase 变量已在 /etc/my.cnf 文件中设置。我注释掉了那行,然后一切正常。

我想在这个线程中分享这个。

于 2015-07-04T04:37:52.370 回答